diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2022-07-21 21:57:37 +0200 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2022-07-22 16:52:35 +0200 |
commit | 2f4204238c7ec6f52b688268b6d3b4b937630074 (patch) | |
tree | 0cb98cbbc47ce95e4676b0ef37f734a4440392fa /src/widgets/styles | |
parent | e79d7f12e6ca15c499a553e4a701a2887e4b184c (diff) | |
download | qtbase-2f4204238c7ec6f52b688268b6d3b4b937630074.tar.gz |
Sync and assert StandardPixmap enums in QPlatformTheme and QStyle
Add missing enum values in QPlatformTheme::standardPixmap to sync with
QStyle::standardPixmap changes from:
785d2b9d0728bbbc0d2a92b7d4186a3114d54128
aa5a595a98f1af4a514485268a18e6cb9cfec783
Add enum values NStandardPixmap at the bottom of both enums as well
as an assertion in QStyle constructor that these values are identical.
Add omitvalue for NStandardPixmap in QStyle (QPlatformTheme enum is
not documented).
Pick-to: 6.4
Change-Id: I9ee528d032c445bed5aeace716893b2af8367de2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index a2469e6b9a..c04b4c1aeb 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -376,6 +376,9 @@ QStyle::QStyle(QStylePrivate &dd) { Q_D(QStyle); d->proxyStyle = this; + Q_STATIC_ASSERT_X(int(StandardPixmap::NStandardPixmap) == + int(QPlatformTheme::StandardPixmap::NStandardPixmap), + "StandardPixmap in QPlatformTheme and QStyle out of sync"); } /*! @@ -2084,6 +2087,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value [since 5.14] SP_DialogIgnoreButton Icon for a standard Ignore button in a QDialogButtonBox. \value [since 5.14] SP_RestoreDefaultsButton Icon for a standard RestoreDefaults button in a QDialogButtonBox. \value [since 6.3] SP_TabCloseButton Icon for the close button in the tab of a QTabBar. + \omitvalue NStandardPixmap \value SP_CustomBase Base value for custom standard pixmaps; custom values must be greater than this value. diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index dc1d08a997..23a5bd5ac2 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -791,6 +791,7 @@ public: SP_DialogIgnoreButton, SP_RestoreDefaultsButton, SP_TabCloseButton, + NStandardPixmap, // assertion value for sync with QPlatformTheme::StandardPixmap // do not add any values below/greater than this SP_CustomBase = 0xf0000000 }; |