summaryrefslogtreecommitdiffstats
path: root/doc/src/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/classes')
-rw-r--r--doc/src/classes/qnamespace.qdoc39
1 files changed, 22 insertions, 17 deletions
diff --git a/doc/src/classes/qnamespace.qdoc b/doc/src/classes/qnamespace.qdoc
index 48f18d0..79a4560 100644
--- a/doc/src/classes/qnamespace.qdoc
+++ b/doc/src/classes/qnamespace.qdoc
@@ -2464,44 +2464,46 @@
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.
+ to the model which type of data it needs. Custom models should return
+ data in these types.
- The general purpose roles are:
+ The general purpose roles (and the associated types) are:
- \value DisplayRole The key data to be rendered in the form of text.
+ \value DisplayRole The key data to be rendered in the form of text. (QString)
\value DecorationRole The data to be rendered as a decoration in the form
- of an icon.
+ of an icon. (QColor)
\value EditRole The data in a form suitable for editing in an
- editor.
- \value ToolTipRole The data displayed in the item's tooltip.
- \value StatusTipRole The data displayed in the status bar.
+ editor. (QString)
+ \value ToolTipRole The data displayed in the item's tooltip. (QString)
+ \value StatusTipRole The data displayed in the status bar. (QString)
\value WhatsThisRole The data displayed for the item in "What's This?"
- mode.
+ mode. (QString)
\value SizeHintRole The size hint for the item that will be supplied
- to views.
+ to views. (QSize)
- Roles describing appearance and meta data:
+ Roles describing appearance and meta data (with associated types):
\value FontRole The font used for items rendered with the default
- delegate.
+ delegate. (QFont)
\value TextAlignmentRole The alignment of the text for items rendered with the
- default delegate.
+ default delegate. (Qt::AlignmentFlag)
\value BackgroundRole The background brush used for items rendered with
- the default delegate.
+ the default delegate. (QBrush)
\value BackgroundColorRole This role is obsolete. Use BackgroundRole instead.
\value ForegroundRole The foreground brush (text color, typically)
used for items rendered with the default delegate.
+ (QBrush)
\value TextColorRole This role is obsolete. Use ForegroundRole instead.
\value CheckStateRole This role is used to obtain the checked state of
- an item (see \l Qt::CheckState).
+ an item. (Qt::CheckState)
- Accessibility roles:
+ Accessibility roles (with associated types):
\value AccessibleTextRole The text to be used by accessibility
extensions and plugins, such as screen
- readers.
+ readers. (QString)
\value AccessibleDescriptionRole A description of the item for accessibility
- purposes.
+ purposes. (QString)
User roles:
@@ -2512,6 +2514,9 @@
\omitvalue ToolTipPropertyRole
\omitvalue StatusTipPropertyRole
\omitvalue WhatsThisPropertyRole
+
+ 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.
*/
/*!