From 0ca69961a2bd544cd417d849018427ae0c8cda05 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 11 Dec 2018 11:21:52 +0100 Subject: 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 Reviewed-by: Oliver Wolff Reviewed-by: Richard Moe Gustavsen --- src/imports/controls/qtquickcontrols2plugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/imports/controls/qtquickcontrols2plugin.cpp') diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 5bbbe422..a03cbd06 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -278,6 +278,10 @@ QList QtQuickControls2Plugin::loadStylePlugins() // release versions of the same Qt libraries (due to the plugin's dependencies). filePath += QStringLiteral("_debug"); #endif // Q_OS_MACOS && QT_DEBUG +#if defined(Q_OS_WIN) && defined(QT_DEBUG) + // Debug versions of plugins have a "d" prefix on Windows. + filePath += QLatin1Char('d'); +#endif // Q_OS_WIN && QT_DEBUG loader.setFileName(filePath); QQuickStylePlugin *stylePlugin = qobject_cast(loader.instance()); if (stylePlugin) -- cgit v1.2.3