def add_item(self, widget, item, checked=True): itemWidget = QListWidgetItem(item) if self.checkable: itemWidget.setCheckState(Qt.Checked if checked else Qt.Unchecked) if self.editable: _set_item_flag(itemWidget, Qt.ItemIsEditable, True) widget.addItem(itemWidget)
def add_item(self, widget, item, checked=True): itemWidget = QListWidgetItem(item) if self.checkable: itemWidget.setCheckState(Qt.Checked if checked else Qt.Unchecked) if self.editable: _set_item_flag(itemWidget, Qt.ItemIsEditable, True) widget.addItem(itemWidget) self.apply_validator(itemWidget, itemWidget.text())
def add_item(self, widget, item): itemWidget = QListWidgetItem(self.to_string(item)) if self.checkable: itemWidget.setCheckState(Qt.Checked) widget.addItem(itemWidget)