aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/font/tst_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/font/tst_font.cpp')
-rw-r--r--tests/auto/font/tst_font.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/font/tst_font.cpp b/tests/auto/font/tst_font.cpp
index 6f04a8c0..b05cdcd8 100644
--- a/tests/auto/font/tst_font.cpp
+++ b/tests/auto/font/tst_font.cpp
@@ -252,7 +252,7 @@ void tst_font::defaultFont_data()
QTest::newRow("ToolButton") << "ToolButton" << QPlatformTheme::ToolButtonFont;
QTest::newRow("ToolSeparator") << "ToolSeparator" << QPlatformTheme::SystemFont;
QTest::newRow("ToolTip") << "ToolTip" << QPlatformTheme::TipLabelFont;
- QTest::newRow("Tumbler") << "Tumbler" << QPlatformTheme::SystemFont;
+ QTest::newRow("Tumbler") << "Tumbler" << QPlatformTheme::ItemViewFont;
}
void tst_font::defaultFont()
@@ -260,12 +260,14 @@ void tst_font::defaultFont()
QFETCH(QString, control);
QFETCH(QPlatformTheme::Font, fontType);
- TestFontTheme theme(QGuiApplicationPrivate::platform_theme);
-
QQmlEngine engine;
QQmlComponent component(&engine);
component.setData(QString("import QtQuick.Controls 2.2; %1 { }").arg(control).toUtf8(), QUrl());
+ // The call to setData() above causes QQuickDefaultTheme to be set as the platform theme,
+ // so we must make sure we only set our theme afterwards.
+ TestFontTheme theme(QGuiApplicationPrivate::platform_theme);
+
QScopedPointer<QObject> object(component.create());
QVERIFY2(!object.isNull(), qPrintable(component.errorString()));