aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-12-11 11:21:52 +0100
committerMitch Curtis <mitch.curtis@qt.io>2019-01-08 15:10:31 +0000
commit0ca69961a2bd544cd417d849018427ae0c8cda05 (patch)
treea956f2bae9646d224e94408bc36cfe1da1df4f87 /tests
parentd438e61fcd52c4a45fefc42edf6e8fe806b11de2 (diff)
Fix incorrect font size in certain styles on Windows
When a style is loaded, QtQuickControls2Plugin::loadStylePlugins() is called. This function uses QPluginLoader to search the style directory for the style plugin. On Windows, the code was looking for the plugin without the debug "d" suffix, causing the style plugin to fail to load for debug builds. This results in the QQuickTheme subclasses not being created, causing controls to be shown with default font sizes. This patch fixes the issue by appending the "d" suffix on Windows. Change-Id: I706dbe39325a104bcd6ce72cb0a8d37025adb055 Fixes: QTBUG-71902 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qquickstyle/tst_qquickstyle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qquickstyle/tst_qquickstyle.cpp b/tests/auto/qquickstyle/tst_qquickstyle.cpp
index f5207a96..3f55bcfb 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/qquicktheme_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include "../shared/util.h"
@@ -102,6 +103,10 @@ void tst_QQuickStyle::lookup()
loadControls();
+ // The font size for editors in the (default) Normal variant is 16.
+ // If this is wrong, the style plugin may not have been loaded.
+ QCOMPARE(QQuickTheme::instance()->font(QQuickTheme::TextArea).pixelSize(), 16);
+
QCOMPARE(QQuickStyle::name(), QString("Material"));
QVERIFY(!QQuickStyle::path().isEmpty());
}