diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/font/tst_font.cpp | 14 | ||||
-rw-r--r-- | tests/auto/palette/tst_palette.cpp | 14 | ||||
-rw-r--r-- | tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp | 9 |
3 files changed, 6 insertions, 31 deletions
diff --git a/tests/auto/font/tst_font.cpp b/tests/auto/font/tst_font.cpp index 048739ff..d01e928d 100644 --- a/tests/auto/font/tst_font.cpp +++ b/tests/auto/font/tst_font.cpp @@ -222,24 +222,14 @@ class TestFontTheme : public QQuickTheme public: static const int NFonts = QQuickTheme::Tumbler + 1; - TestFontTheme() + void resolve() override { - std::fill(fonts, fonts + NFonts, static_cast<QFont *>(0)); - for (int i = 0; i < NFonts; ++i) { QFont font = QFont(); font.setPixelSize(i + 10); - fonts[i] = new QFont(font); + setFont(static_cast<Scope>(i), font); } } - - const QFont *font(Scope scope) const override - { - return fonts[scope]; - } - -private: - QFont *fonts[NFonts]; }; Q_DECLARE_METATYPE(QQuickTheme::Scope) 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<QPalette *>(0)); - for (int i = 0; i < NPalettes; ++i) - palettes[i] = new QPalette(QColor::fromRgb(i)); + setPalette(static_cast<Scope>(i), QPalette(QColor::fromRgb(i))); } - - const QPalette *palette(Scope scope) const override - { - return palettes[scope]; - } - -private: - QPalette *palettes[NPalettes]; }; Q_DECLARE_METATYPE(QQuickTheme::Scope) diff --git a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp index 742ad9fd..ef2d0893 100644 --- a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp +++ b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp @@ -558,15 +558,10 @@ void tst_QQuickApplicationWindow::font() class TestTheme : public QQuickTheme { public: - TestTheme() : m_font("Courier") { } - - const QFont *font(Scope scope) const override + void resolve() override { - Q_UNUSED(scope); - return &m_font; + setFont(System, QFont("Courier")); } - - QFont m_font; }; void tst_QQuickApplicationWindow::defaultFont() |