summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qitemdelegate.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-06-26 15:02:51 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-06-30 08:50:55 +0200
commit921337f98c54d3c4a252569acd2152a1dea8c4bb (patch)
tree7305e86b5dd0976e66199a1f01b0c3244667ae23 /src/widgets/itemviews/qitemdelegate.cpp
parent22a8335d681fd1fbdeffe62da37d4f2526c0d504 (diff)
Move pixelator example to manual test
Pick-to: 6.5 6.6 Change-Id: I3ce2bc269a9f77bce3dd41f0127d01091c1408f6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qitemdelegate.cpp')
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index ad3898e8d9..1c1dec68d2 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -342,8 +342,10 @@ QString QItemDelegatePrivate::valueToText(const QVariant &value, const QStyleOpt
For example, a selected item may need to be displayed differently to
unselected items, as shown in the following code:
- \snippet itemviews/pixelator/pixeldelegate.cpp 2
- \dots
+ \code
+ if (option.state & QStyle::State_Selected)
+ painter->fillRect(option.rect, option.palette.highlight());
+ \endcode
After painting, you should ensure that the painter is returned to its
the state it was supplied in when this function was called. For example,