diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-13 21:27:58 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-14 23:43:38 +0200 |
commit | 2cc8d801aace8cd8983751ede23ea6a052d72aac (patch) | |
tree | 5374856e02dac96d58ca52735309eec483b5226c /src/gui/kernel/qpalette.h | |
parent | 63790184c79d2765ea726488726cd9f2b43b91d1 (diff) |
Unwrap private QPalette data member
Following 556511f9f39ddc887481e0cd5a877134ceb0da6b, there is only one
data member in addition to the shared QPalettePrivate, so we don't need
a data struct anymore.
Change-Id: I8d7f33ed042e47464eb5f60a048956f8bf70e0b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/kernel/qpalette.h')
-rw-r--r-- | src/gui/kernel/qpalette.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index 8b291dec58..776d489d44 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -68,13 +68,13 @@ public: ~QPalette(); QPalette &operator=(const QPalette &palette); QPalette(QPalette &&other) noexcept - : d(qExchange(other.d, nullptr)), data(other.data) + : d(qExchange(other.d, nullptr)), currentGroup(other.currentGroup) {} QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPalette) void swap(QPalette &other) noexcept { - qSwap(data, other.data); + qSwap(currentGroup, other.currentGroup); qSwap(d, other.d); } @@ -95,8 +95,8 @@ public: }; Q_ENUM(ColorRole) - inline ColorGroup currentColorGroup() const { return data.currentGroup; } - inline void setCurrentColorGroup(ColorGroup cg) { data.currentGroup = cg; } + inline ColorGroup currentColorGroup() const { return currentGroup; } + inline void setCurrentColorGroup(ColorGroup cg) { currentGroup = cg; } inline const QColor &color(ColorGroup cg, ColorRole cr) const { return brush(cg, cr).color(); } @@ -169,10 +169,7 @@ private: void detach(); QPalettePrivate *d; - struct Data { - ColorGroup currentGroup{Active}; - }; - Data data; + ColorGroup currentGroup{Active}; friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &s, const QPalette &p); }; |