pub struct ItemDataRole(/* private fields */);
Expand description
Each item in the model has a set of data elements associated with it, each with its own role. The roles are used by the view to indicate to the model which type of data it needs. Custom models should return data in these types.
C++ enum: Qt::ItemDataRole
.
Each item in the model has a set of data elements associated with it, each with its own role. The roles are used by the view to indicate to the model which type of data it needs. Custom models should return data in these types.
The general purpose roles (and the associated types) are:
Roles describing appearance and meta data (with associated types):
Accessibility roles (with associated types):
User roles:
For user roles, it is up to the developer to decide which types to use and ensure that components use the correct types when accessing and setting data.
Implementations§
Source§impl ItemDataRole
impl ItemDataRole
Sourcepub const DisplayRole: ItemDataRole
pub const DisplayRole: ItemDataRole
The key data to be rendered in the form of text. (QString) (C++ enum variant: DisplayRole = 0
)
Sourcepub const DecorationRole: ItemDataRole
pub const DecorationRole: ItemDataRole
Sourcepub const EditRole: ItemDataRole
pub const EditRole: ItemDataRole
The data in a form suitable for editing in an editor. (QString) (C++ enum variant: EditRole = 2
)
Sourcepub const ToolTipRole: ItemDataRole
pub const ToolTipRole: ItemDataRole
The data displayed in the item’s tooltip. (QString) (C++ enum variant: ToolTipRole = 3
)
Sourcepub const StatusTipRole: ItemDataRole
pub const StatusTipRole: ItemDataRole
The data displayed in the status bar. (QString) (C++ enum variant: StatusTipRole = 4
)
Sourcepub const WhatsThisRole: ItemDataRole
pub const WhatsThisRole: ItemDataRole
The data displayed for the item in “What’s This?” mode. (QString) (C++ enum variant: WhatsThisRole = 5
)
Sourcepub const FontRole: ItemDataRole
pub const FontRole: ItemDataRole
The font used for items rendered with the default delegate. (QFont) (C++ enum variant: FontRole = 6
)
Sourcepub const TextAlignmentRole: ItemDataRole
pub const TextAlignmentRole: ItemDataRole
The alignment of the text for items rendered with the default delegate. (Qt::Alignment) (C++ enum variant: TextAlignmentRole = 7
)
Sourcepub const BackgroundColorRole: ItemDataRole
pub const BackgroundColorRole: ItemDataRole
This role is obsolete. Use BackgroundRole instead. (C++ enum variant: BackgroundColorRole = 8
)
Sourcepub const BackgroundRole: ItemDataRole
pub const BackgroundRole: ItemDataRole
The background brush used for items rendered with the default delegate. (QBrush) (C++ enum variant: BackgroundRole = 8
)
Sourcepub const TextColorRole: ItemDataRole
pub const TextColorRole: ItemDataRole
This role is obsolete. Use ForegroundRole instead. (C++ enum variant: TextColorRole = 9
)
Sourcepub const ForegroundRole: ItemDataRole
pub const ForegroundRole: ItemDataRole
The foreground brush (text color, typically) used for items rendered with the default delegate. (QBrush) (C++ enum variant: ForegroundRole = 9
)
Sourcepub const CheckStateRole: ItemDataRole
pub const CheckStateRole: ItemDataRole
This role is used to obtain the checked state of an item. (Qt::CheckState) (C++ enum variant: CheckStateRole = 10
)
Sourcepub const AccessibleTextRole: ItemDataRole
pub const AccessibleTextRole: ItemDataRole
The text to be used by accessibility extensions and plugins, such as screen readers. (QString) (C++ enum variant: AccessibleTextRole = 11
)
Sourcepub const AccessibleDescriptionRole: ItemDataRole
pub const AccessibleDescriptionRole: ItemDataRole
A description of the item for accessibility purposes. (QString) (C++ enum variant: AccessibleDescriptionRole = 12
)
Sourcepub const SizeHintRole: ItemDataRole
pub const SizeHintRole: ItemDataRole
The size hint for the item that will be supplied to views. (QSize) (C++ enum variant: SizeHintRole = 13
)
Sourcepub const InitialSortOrderRole: ItemDataRole
pub const InitialSortOrderRole: ItemDataRole
This role is used to obtain the initial sort order of a header view section. (Qt::SortOrder). This role was introduced in Qt 4.8. (C++ enum variant: InitialSortOrderRole = 14
)
Sourcepub const DisplayPropertyRole: ItemDataRole
pub const DisplayPropertyRole: ItemDataRole
C++ enum variant: DisplayPropertyRole = 27
Sourcepub const DecorationPropertyRole: ItemDataRole
pub const DecorationPropertyRole: ItemDataRole
C++ enum variant: DecorationPropertyRole = 28
Sourcepub const ToolTipPropertyRole: ItemDataRole
pub const ToolTipPropertyRole: ItemDataRole
C++ enum variant: ToolTipPropertyRole = 29
Sourcepub const StatusTipPropertyRole: ItemDataRole
pub const StatusTipPropertyRole: ItemDataRole
C++ enum variant: StatusTipPropertyRole = 30
Sourcepub const WhatsThisPropertyRole: ItemDataRole
pub const WhatsThisPropertyRole: ItemDataRole
C++ enum variant: WhatsThisPropertyRole = 31
Sourcepub const UserRole: ItemDataRole
pub const UserRole: ItemDataRole
The first role that can be used for application-specific purposes. (C++ enum variant: UserRole = 256
)
Trait Implementations§
Source§impl Clone for ItemDataRole
impl Clone for ItemDataRole
Source§fn clone(&self) -> ItemDataRole
fn clone(&self) -> ItemDataRole
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more