pub struct ItemFlag(/* private fields */);
Expand description
This enum describes the properties of an item:
C++ enum: Qt::ItemFlag
.
This enum describes the properties of an item:
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 QAbstractItemModel::hasChildren to return true for an index if that index has the Qt::ItemNeverHasChildren flag set.
The ItemFlags type is a typedef for QFlags<ItemFlag>. It stores an OR combination of ItemFlag values.
See also QAbstractItemModel.
Implementations§
source§impl ItemFlag
impl ItemFlag
sourcepub const NoItemFlags: ItemFlag = _
pub const NoItemFlags: ItemFlag = _
It does not have any properties set. (C++ enum variant: NoItemFlags = 0
)
sourcepub const ItemIsSelectable: ItemFlag = _
pub const ItemIsSelectable: ItemFlag = _
It can be selected. (C++ enum variant: ItemIsSelectable = 1
)
sourcepub const ItemIsEditable: ItemFlag = _
pub const ItemIsEditable: ItemFlag = _
It can be edited. (C++ enum variant: ItemIsEditable = 2
)
sourcepub const ItemIsDragEnabled: ItemFlag = _
pub const ItemIsDragEnabled: ItemFlag = _
It can be dragged. (C++ enum variant: ItemIsDragEnabled = 4
)
sourcepub const ItemIsDropEnabled: ItemFlag = _
pub const ItemIsDropEnabled: ItemFlag = _
It can be used as a drop target. (C++ enum variant: ItemIsDropEnabled = 8
)
sourcepub const ItemIsUserCheckable: ItemFlag = _
pub const ItemIsUserCheckable: ItemFlag = _
It can be checked or unchecked by the user. (C++ enum variant: ItemIsUserCheckable = 16
)
sourcepub const ItemIsEnabled: ItemFlag = _
pub const ItemIsEnabled: ItemFlag = _
The user can interact with the item. (C++ enum variant: ItemIsEnabled = 32
)
sourcepub const ItemIsAutoTristate: ItemFlag = _
pub const ItemIsAutoTristate: ItemFlag = _
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). (C++ enum variant: ItemIsAutoTristate = 64
)
sourcepub const ItemIsTristate: ItemFlag = _
pub const ItemIsTristate: ItemFlag = _
This enum value is deprecated. Use Qt::ItemIsAutoTristate instead. (C++ enum variant: ItemIsTristate = 64
)
sourcepub const ItemNeverHasChildren: ItemFlag = _
pub const ItemNeverHasChildren: ItemFlag = _
The item never has child items. This is used for optimization purposes only. (C++ enum variant: ItemNeverHasChildren = 128
)
sourcepub const ItemIsUserTristate: ItemFlag = _
pub const ItemIsUserTristate: ItemFlag = _
The user can cycle through three separate states. This value has been added in Qt 5.5. (C++ enum variant: ItemIsUserTristate = 256
)