summaryrefslogtreecommitdiffstats
path: root/src/controls/Private/qquickcontrolsettings.cpp
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@theqtcompany.com>2015-03-10 13:45:05 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-03-10 14:40:59 +0000
commite3eea0761899ffada4d61e36a1c4ed569eed0e62 (patch)
treeb7f5288d0aacbe2ccf8e0a3c56d155e6f7c1c174 /src/controls/Private/qquickcontrolsettings.cpp
parenta38f3497dde51659b4c7fe0f61b6f9a599f43caf (diff)
Fix style not always loaded properly from plugin
When the plugin does not have the qt_quick_controls_style_init and qt_quick_controls_style_path functions. Change-Id: Iea091b1444e6437b9e81db810db445ede50a2365 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/Private/qquickcontrolsettings.cpp')
-rw-r--r--src/controls/Private/qquickcontrolsettings.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp
index c000a6580..c60e77d95 100644
--- a/src/controls/Private/qquickcontrolsettings.cpp
+++ b/src/controls/Private/qquickcontrolsettings.cpp
@@ -232,18 +232,15 @@ bool QQuickControlSettings::resolveCurrentStylePath()
}
// Check for the existence of this first, as we don't want to init if this doesn't exist.
- StylePathFunc pathFunc = (StylePathFunc) lib.resolve("qt_quick_controls_style_path");
- if (!pathFunc) {
- qWarning() << "WARNING: Style" << m_name << "is a plugin but does not expose qt_quick_controls_style_path";
- return false;
- }
-
StyleInitFunc initFunc = (StyleInitFunc) lib.resolve("qt_quick_controls_style_init");
if (initFunc)
initFunc();
+ StylePathFunc pathFunc = (StylePathFunc) lib.resolve("qt_quick_controls_style_path");
+ if (pathFunc) {
+ styleData.m_styleDirPath = QString::fromLocal8Bit(pathFunc());
+ m_styleMap[m_name] = styleData;
+ }
- styleData.m_styleDirPath = QString::fromLocal8Bit(pathFunc());
- m_styleMap[m_name] = styleData;
return true;
}
@@ -270,8 +267,7 @@ void QQuickControlSettings::findStyle(QQmlEngine *engine, const QString &styleNa
// If there's no plugin for the style, then the style's files are
// contained in this directory (which contains a qmldir file instead).
- if (styleData.m_stylePluginPath.isEmpty())
- styleData.m_styleDirPath = dir.absolutePath();
+ styleData.m_styleDirPath = dir.absolutePath();
m_styleMap[styleName] = styleData;
}