[][src]Struct qt_core::ItemDataRole

#[repr(transparent)]
pub struct 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.

C++ enum: Qt::ItemDataRole.

C++ documentation:

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.

Methods

impl ItemDataRole[src]

pub fn to_int(&self) -> c_int[src]

impl ItemDataRole[src]

pub const DisplayRole: ItemDataRole[src]

The key data to be rendered in the form of text. (QString) (C++ enum variant: DisplayRole = 0)

pub const DecorationRole: ItemDataRole[src]

The data to be rendered as a decoration in the form of an icon. (QColor, QIcon or QPixmap) (C++ enum variant: DecorationRole = 1)

pub const EditRole: ItemDataRole[src]

The data in a form suitable for editing in an editor. (QString) (C++ enum variant: EditRole = 2)

pub const ToolTipRole: ItemDataRole[src]

The data displayed in the item's tooltip. (QString) (C++ enum variant: ToolTipRole = 3)

pub const StatusTipRole: ItemDataRole[src]

The data displayed in the status bar. (QString) (C++ enum variant: StatusTipRole = 4)

pub const WhatsThisRole: ItemDataRole[src]

The data displayed for the item in "What's This?" mode. (QString) (C++ enum variant: WhatsThisRole = 5)

pub const FontRole: ItemDataRole[src]

The font used for items rendered with the default delegate. (QFont) (C++ enum variant: FontRole = 6)

pub const TextAlignmentRole: ItemDataRole[src]

The alignment of the text for items rendered with the default delegate. (Qt::Alignment) (C++ enum variant: TextAlignmentRole = 7)

pub const BackgroundColorRole: ItemDataRole[src]

This role is obsolete. Use BackgroundRole instead. (C++ enum variant: BackgroundColorRole = 8)

pub const BackgroundRole: ItemDataRole[src]

The background brush used for items rendered with the default delegate. (QBrush) (C++ enum variant: BackgroundRole = 8)

pub const TextColorRole: ItemDataRole[src]

This role is obsolete. Use ForegroundRole instead. (C++ enum variant: TextColorRole = 9)

pub const ForegroundRole: ItemDataRole[src]

The foreground brush (text color, typically) used for items rendered with the default delegate. (QBrush) (C++ enum variant: ForegroundRole = 9)

pub const CheckStateRole: ItemDataRole[src]

This role is used to obtain the checked state of an item. (Qt::CheckState) (C++ enum variant: CheckStateRole = 10)

pub const AccessibleTextRole: ItemDataRole[src]

The text to be used by accessibility extensions and plugins, such as screen readers. (QString) (C++ enum variant: AccessibleTextRole = 11)

pub const AccessibleDescriptionRole: ItemDataRole[src]

A description of the item for accessibility purposes. (QString) (C++ enum variant: AccessibleDescriptionRole = 12)

pub const SizeHintRole: ItemDataRole[src]

The size hint for the item that will be supplied to views. (QSize) (C++ enum variant: SizeHintRole = 13)

pub const InitialSortOrderRole: ItemDataRole[src]

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)

pub const DisplayPropertyRole: ItemDataRole[src]

C++ enum variant: DisplayPropertyRole = 27

pub const DecorationPropertyRole: ItemDataRole[src]

C++ enum variant: DecorationPropertyRole = 28

pub const ToolTipPropertyRole: ItemDataRole[src]

C++ enum variant: ToolTipPropertyRole = 29

pub const StatusTipPropertyRole: ItemDataRole[src]

C++ enum variant: StatusTipPropertyRole = 30

pub const WhatsThisPropertyRole: ItemDataRole[src]

C++ enum variant: WhatsThisPropertyRole = 31

pub const UserRole: ItemDataRole[src]

The first role that can be used for application-specific purposes. (C++ enum variant: UserRole = 256)

Trait Implementations

impl Clone for ItemDataRole[src]

impl Copy for ItemDataRole[src]

impl Debug for ItemDataRole[src]

impl Eq for ItemDataRole[src]

impl From<ItemDataRole> for c_int[src]

impl From<i32> for ItemDataRole[src]

impl PartialEq<ItemDataRole> for ItemDataRole[src]

impl StructuralEq for ItemDataRole[src]

impl StructuralPartialEq for ItemDataRole[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.