diff options
author | Vitaly Fanaskov <vitaly.fanaskov@qt.io> | 2019-08-06 15:50:22 +0200 |
---|---|---|
committer | Vitaly Fanaskov <vitaly.fanaskov@qt.io> | 2020-03-18 17:29:24 +0100 |
commit | 31f5c21ddb571d744efd1885c0687816b3a12225 (patch) | |
tree | 1e7ccb81c2db278ed265638eb25a69c546430575 /src/imports/controls/fusion/qquickfusiondial.cpp | |
parent | fccd63d1296a611a282ae15d0c437eb4b09e6eb1 (diff) |
Remove old QQuickPalette implementation
The existing implementation was removed in order to reduce massive code
duplication and simplify color resolving process. Unit tests were fixed
accordingly.
See related changes in the qtdeclarative module for the further details.
[ChangeLog][General] the palette API is a part of
QQuickItem now.
Change-Id: Ic94ab4632e626c11d9b26f035e2a8a119c9088ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/imports/controls/fusion/qquickfusiondial.cpp')
-rw-r--r-- | src/imports/controls/fusion/qquickfusiondial.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/imports/controls/fusion/qquickfusiondial.cpp b/src/imports/controls/fusion/qquickfusiondial.cpp index 50436634..eb6f21ad 100644 --- a/src/imports/controls/fusion/qquickfusiondial.cpp +++ b/src/imports/controls/fusion/qquickfusiondial.cpp @@ -38,6 +38,8 @@ #include <QtGui/qpainter.h> #include <QtGui/private/qmath_p.h> +#include <QtQuick/private/qquickpalette_p.h> +#include <QtQuick/private/qquickitem_p.h> QT_BEGIN_NAMESPACE @@ -60,20 +62,6 @@ void QQuickFusionDial::setHighlight(bool highlight) update(); } -QPalette QQuickFusionDial::palette() const -{ - return m_palette; -} - -void QQuickFusionDial::setPalette(const QPalette &palette) -{ - if (palette == m_palette) - return; - - m_palette = palette; - update(); -} - // based on QStyleHelper::drawDial() void QQuickFusionDial::paint(QPainter *painter) { @@ -82,7 +70,7 @@ void QQuickFusionDial::paint(QPainter *painter) if (width <= 0 || height <= 0 || !isVisible()) return; - QColor buttonColor = m_palette.button().color(); + QColor buttonColor = QQuickItemPrivate::get(this)->palette()->button(); const bool enabled = isEnabled(); qreal r = qMin(width, height) / 2.0; r -= r/50; @@ -137,7 +125,7 @@ void QQuickFusionDial::paint(QPainter *painter) painter->drawEllipse(br.adjusted(1, 1, -1, -1)); if (m_highlight) { - QColor highlight = m_palette.highlight().color(); + QColor highlight = QQuickItemPrivate::get(this)->palette()->highlight(); highlight.setHsv(highlight.hue(), qMin(160, highlight.saturation()), qMax(230, highlight.value())); |