From f40dc11886e8130bad5771ed80920e6e72dfc09e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 16 May 2018 13:50:35 +0200 Subject: QQuickTheme: add setters to make getters non-virtual This allows us to add more themable attributes (on the side of fonts and palettes) after the QQuickTheme API has been made public, because it won't require adding virtuals. Only the resolve() method is virtual. Task-number: QTBUG-67062 Change-Id: I6a5cc8d15aeaa5a9a0fe9b6d2591077f8822daac Reviewed-by: Mitch Curtis --- tests/auto/palette/tst_palette.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'tests/auto/palette/tst_palette.cpp') diff --git a/tests/auto/palette/tst_palette.cpp b/tests/auto/palette/tst_palette.cpp index 4c067e17..7bdbbdc3 100644 --- a/tests/auto/palette/tst_palette.cpp +++ b/tests/auto/palette/tst_palette.cpp @@ -221,21 +221,11 @@ class TestTheme : public QQuickTheme public: static const int NPalettes = QQuickTheme::Tumbler + 1; - TestTheme() + void resolve() override { - std::fill(palettes, palettes + NPalettes, static_cast(0)); - for (int i = 0; i < NPalettes; ++i) - palettes[i] = new QPalette(QColor::fromRgb(i)); + setPalette(static_cast(i), QPalette(QColor::fromRgb(i))); } - - const QPalette *palette(Scope scope) const override - { - return palettes[scope]; - } - -private: - QPalette *palettes[NPalettes]; }; Q_DECLARE_METATYPE(QQuickTheme::Scope) -- cgit v1.2.3