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
)