(self)
| 954 | signal_current_item_changed = Signal(int, str) |
| 955 | |
| 956 | def __init__(self): |
| 957 | super().__init__() |
| 958 | |
| 959 | self._item_list = [] |
| 960 | # The 'first item' is appended to the beginning of the list. The index returned |
| 961 | # by the functions of the class is the index of 'self._item_list' array, that |
| 962 | # does not include the 'first item'. |
| 963 | self._first_item = "Select Line:" |
| 964 | |
| 965 | self.cb_element_list = QComboBox() |
| 966 | self.cb_element_list.currentIndexChanged.connect(self.cb_element_list_current_index_changed) |
| 967 | |
| 968 | self.setMaximumWidth(300) |
| 969 | self.pb_prev = PushButtonMinimumWidth("<") |
| 970 | self.pb_prev.pressed.connect(self.pb_prev_pressed) |
| 971 | self.pb_next = PushButtonMinimumWidth(">") |
| 972 | self.pb_next.pressed.connect(self.pb_next_pressed) |
| 973 | |
| 974 | self.cb_element_list.addItems([self._first_item]) |
| 975 | self.cb_element_list.setCurrentIndex(0) |
| 976 | |
| 977 | hbox = QHBoxLayout() |
| 978 | hbox.setSpacing(0) |
| 979 | hbox.setContentsMargins(0, 0, 0, 0) |
| 980 | hbox.addWidget(self.pb_prev) |
| 981 | hbox.addWidget(self.cb_element_list) |
| 982 | hbox.addWidget(self.pb_next) |
| 983 | |
| 984 | self.setLayout(hbox) |
| 985 | |
| 986 | sp = QSizePolicy() |
| 987 | sp.setControlType(QSizePolicy.PushButton) |
| 988 | sp.setHorizontalPolicy(QSizePolicy.Maximum) |
| 989 | self.setSizePolicy(sp) |
| 990 | |
| 991 | def set_item_list(self, item_list): |
| 992 | _, current_item = self.get_current_item() |
nothing calls this directly
no test coverage detected