def add_combobox_empty(self, name, title, curtext=""): if title: self.add_label(title) combo = QComboBox() combo.setObjectName(name) combo.addItem(curtext) self.group_area.layout().addWidget(combo) self.empty_combo = combo
def add_combobox(self, name, options, current, title="", on_change=None): if title: self.add_label(title) combo = QComboBox() combo.setObjectName(name) for op in options: combo.addItem(op) cur_ind = 0 if current in options: cur_ind = options.index(current) combo.setCurrentIndex(cur_ind) if on_change is not None: combo.activated.connect(on_change) self.group_area.layout().addWidget(combo)