aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qquickstyle/data/custom.conf4
-rw-r--r--tests/auto/qquickstyle/data/default.conf4
-rw-r--r--tests/auto/qquickstyle/data/fusion.conf4
-rw-r--r--tests/auto/qquickstyle/data/imagine.conf4
-rw-r--r--tests/auto/qquickstyle/data/material.conf4
-rw-r--r--tests/auto/qquickstyle/data/universal.conf4
-rw-r--r--tests/auto/qquickstyle/tst_qquickstyle.cpp17
7 files changed, 40 insertions, 1 deletions
diff --git a/tests/auto/qquickstyle/data/custom.conf b/tests/auto/qquickstyle/data/custom.conf
index 4e17d1dc..2230b452 100644
--- a/tests/auto/qquickstyle/data/custom.conf
+++ b/tests/auto/qquickstyle/data/custom.conf
@@ -1,2 +1,6 @@
[Controls]
Style=:/Custom
+
+[Custom]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/data/default.conf b/tests/auto/qquickstyle/data/default.conf
index caace6db..12ca5d8f 100644
--- a/tests/auto/qquickstyle/data/default.conf
+++ b/tests/auto/qquickstyle/data/default.conf
@@ -1,2 +1,6 @@
[Controls]
Style=Default
+
+[Default]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/data/fusion.conf b/tests/auto/qquickstyle/data/fusion.conf
index 9cd14111..1f343e65 100644
--- a/tests/auto/qquickstyle/data/fusion.conf
+++ b/tests/auto/qquickstyle/data/fusion.conf
@@ -1,2 +1,6 @@
[Controls]
Style=Fusion
+
+[Fusion]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/data/imagine.conf b/tests/auto/qquickstyle/data/imagine.conf
index add378d4..919bbcf0 100644
--- a/tests/auto/qquickstyle/data/imagine.conf
+++ b/tests/auto/qquickstyle/data/imagine.conf
@@ -1,2 +1,6 @@
[Controls]
Style=Imagine
+
+[Imagine]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/data/material.conf b/tests/auto/qquickstyle/data/material.conf
index b6c7c87e..27c7931a 100644
--- a/tests/auto/qquickstyle/data/material.conf
+++ b/tests/auto/qquickstyle/data/material.conf
@@ -1,2 +1,6 @@
[Controls]
Style=Material
+
+[Material]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/data/universal.conf b/tests/auto/qquickstyle/data/universal.conf
index 8c6dd807..a5ac3ca3 100644
--- a/tests/auto/qquickstyle/data/universal.conf
+++ b/tests/auto/qquickstyle/data/universal.conf
@@ -1,2 +1,6 @@
[Controls]
Style=Universal
+
+[Universal]
+Font\PixelSize=3
+Palette\WindowText=#ff0000
diff --git a/tests/auto/qquickstyle/tst_qquickstyle.cpp b/tests/auto/qquickstyle/tst_qquickstyle.cpp
index 3f55bcfb..e99dad62 100644
--- a/tests/auto/qquickstyle/tst_qquickstyle.cpp
+++ b/tests/auto/qquickstyle/tst_qquickstyle.cpp
@@ -39,6 +39,7 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
+#include <QtQuickTemplates2/private/qquicklabel_p.h>
#include <QtQuickTemplates2/private/qquicktheme_p.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -133,11 +134,25 @@ void tst_QQuickStyle::configurationFile()
qputenv("QT_QUICK_CONTROLS_CONF", testFile(fileName).toLocal8Bit());
- loadControls();
+ // Load a control. The import causes the configuration file to be read.
+ QQmlEngine engine;
+ QQmlComponent labelComponent(&engine);
+ labelComponent.setData("import QtQuick 2.0; import QtQuick.Controls 2.12; Label {}", QUrl());
+
+ QScopedPointer<QObject> object(labelComponent.create());
+ QVERIFY2(!object.isNull(), qPrintable(labelComponent.errorString()));
QCOMPARE(QQuickStyle::name(), expectedStyle);
if (!expectedPath.isEmpty())
QCOMPARE(QQuickStyle::path(), expectedPath);
+
+ // Test that fonts and palettes specified in configuration files are respected.
+ QQuickLabel *label = qobject_cast<QQuickLabel *>(object.data());
+ QVERIFY(label);
+ // Make it small so that there's less possibility for the default/system
+ // pixel size to match it and give us false positives.
+ QCOMPARE(label->font().pixelSize(), 3);
+ QCOMPARE(label->palette().windowText(), Qt::red);
}
void tst_QQuickStyle::commandLineArgument()