summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-13 13:58:11 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-28 11:36:49 +0000
commit8b925ca18e6007da90dcc85a5b94c441d44188e8 (patch)
treec815ad6046b589eef0b9f34680a0c44956a6691b /src
parent8836fde9ee91df9c481c8fb17190499ae3cbc6bb (diff)
Document change to style sheet selectors for enum properties
The change is presumably an unintentional side effect of QVariant and QMetaType system changes in Qt 6, but it arguably is a good change. Document it in the porting guide, while evaluating whether (and figure out how) we want to support integer values as well. Task-number: QTBUG-99642 Change-Id: Id1589c594bcdc2afe5c4fd0e47a158cd5e03e52f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 2d935dc7f9d80f0a7b83111695a23b3b5bb99a31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/doc/src/qt6-changes.qdoc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widgets/doc/src/qt6-changes.qdoc b/src/widgets/doc/src/qt6-changes.qdoc
index c52b2645d1..4605313ff1 100644
--- a/src/widgets/doc/src/qt6-changes.qdoc
+++ b/src/widgets/doc/src/qt6-changes.qdoc
@@ -107,6 +107,27 @@
The various initStyleOption() methods in widget classes are now virtual.
+ \section2 Style sheet changes
+
+ Styling a widget by its property in Qt 5 vs Qt 6 is different, especially if the
+ property is an enum. In Qt 5, the selector value for such a property is the integer
+ equivalent of the enum value, while in Qt 6 the string value is used. The following
+ example demonstrates this difference:
+
+ \code
+ // Qt 5 style sheet
+ QToolButton[popupMode="1"] {
+ padding-right: 20px;
+ }
+ \endcode
+
+ \code
+ // Qt 6 style sheet
+ QToolButton[popupMode=MenuButtonPopup] {
+ padding-right: 20px;
+ }
+ \endcode
+
\section1 Utility Classes
\section2 QUndoCommand, QUndoStack, and QUndoGroup