This enum describes the properties of an item:
Constant | Description |
---|---|
Qt.NoItemFlags | It does not have any properties set. |
Qt.ItemIsSelectable | It can be selected. |
Qt.ItemIsEditable | It can be edited. |
Qt.ItemIsDragEnabled | It can be dragged. |
Qt.ItemIsDropEnabled | It can be used as a drop target. |
Qt.ItemIsUserCheckable | It can be checked or unchecked by the user. |
Qt.ItemIsEnabled | The user can interact with the item. |
Qt.ItemIsAutoTristate | The item’s state depends on the state of its children. This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked). |
Qt.ItemIsTristate | This enum value is deprecated. Use instead. |
Qt.ItemNeverHasChildren | The item never has child items. This is used for optimization purposes only. |
Qt.ItemIsUserTristate | The user can cycle through three separate states. This value was added in Qt 5.5. |
Note that checkable items need to be given both a suitable set of flags and an initial state, indicating whether the item is checked or not. This is handled automatically for model/view components, but needs to be explicitly set for instances of QListWidgetItem , QTableWidgetItem , and QTreeWidgetItem . |
Note that it is undefined behavior to reimplement hasChildren to return true for an index if that index has the flag set.