Struct qt_core::ItemDataRole
source · 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 moresource§impl Debug for ItemDataRole
impl Debug for ItemDataRole
source§impl From<ItemDataRole> for c_int
impl From<ItemDataRole> for c_int
source§fn from(value: ItemDataRole) -> Self
fn from(value: ItemDataRole) -> Self
source§impl From<i32> for ItemDataRole
impl From<i32> for ItemDataRole
source§impl PartialEq for ItemDataRole
impl PartialEq for ItemDataRole
source§fn eq(&self, other: &ItemDataRole) -> bool
fn eq(&self, other: &ItemDataRole) -> bool
self
and other
values to be equal, and is used
by ==
.