diff options
author | Geir Vattekar <geir.vattekar@nokia.com> | 2011-08-25 13:18:57 (GMT) |
---|---|---|
committer | Geir Vattekar <geir.vattekar@nokia.com> | 2011-08-25 13:18:57 (GMT) |
commit | 678a8a137b334e86a30ea3f8ed2334dbb4f92631 (patch) | |
tree | a396d9d34ff5ae37c5b3ae70ebfd8c012d48b535 /doc | |
parent | 9038a4ce14c58aebb04c38b3b8229d3be2021c81 (diff) | |
download | Qt-678a8a137b334e86a30ea3f8ed2334dbb4f92631.zip Qt-678a8a137b334e86a30ea3f8ed2334dbb4f92631.tar.gz Qt-678a8a137b334e86a30ea3f8ed2334dbb4f92631.tar.bz2 |
Doc: QItemDelegate->QStyledItemDelegate in Star Delegate docs
Task-number: QTBUG-9440
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/examples/stardelegate.qdoc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/src/examples/stardelegate.qdoc b/doc/src/examples/stardelegate.qdoc index 3b009d5..ed3ae7e 100644 --- a/doc/src/examples/stardelegate.qdoc +++ b/doc/src/examples/stardelegate.qdoc @@ -42,12 +42,12 @@ editing takes place. Delegates are subclasses of QAbstractItemDelegate. Qt provides - QItemDelegate, which inherits QAbstractItemDelegate and handles - the most common data types (notably \c int and QString). If we - need to support custom data types, or want to customize the + QStyledItemDelegate, which inherits QAbstractItemDelegate and + handles the most common data types (notably \c int and QString). + If we need to support custom data types, or want to customize the rendering or the editing for existing data types, we can subclass - QAbstractItemDelegate or QItemDelegate. See \l{Delegate Classes} - for more information about delegates, and \l{Model/View + QAbstractItemDelegate or QStyledItemDelegate. See \l{Delegate + Classes} for more information about delegates, and \l{Model/View Programming} if you need a high-level introduction to Qt's model/view architecture (including delegates). @@ -62,9 +62,9 @@ expressed as stars, such as "2 out of 5 stars" or "5 out of 6 stars". - \o \c StarDelegate inherits QItemDelegate and provides support + \o \c StarDelegate inherits QStyledItemDelegate and provides support for \c StarRating (in addition to the data types already - handled by QItemDelegate). + handled by QStyledItemDelegate). \o \c StarEditor inherits QWidget and is used by \c StarDelegate to let the user edit a star rating using the mouse. @@ -80,20 +80,20 @@ \snippet examples/itemviews/stardelegate/stardelegate.h 0 All public functions are reimplemented virtual functions from - QItemDelegate to provide custom rendering and editing. + QStyledItemDelegate to provide custom rendering and editing. \section1 StarDelegate Class Implementation - The \l{QAbstractItemDelegate::}{paint()} function is - reimplemented from QItemDelegate and is called whenever the view - needs to repaint an item: + The \l{QAbstractItemDelegate::}{paint()} function is reimplemented + from QStyledItemDelegate and is called whenever the view needs to + repaint an item: \snippet examples/itemviews/stardelegate/stardelegate.cpp 0 The function is invoked once for each item, represented by a QModelIndex object from the model. If the data stored in the item is a \c StarRating, we paint it ourselves; otherwise, we let - QItemDelegate paint it for us. This ensures that the \c + QStyledItemDelegate paint it for us. This ensures that the \c StarDelegate can handle the most common data types. In the case where the item is a \c StarRating, we draw the |