aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/qquickstyleplugin.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-19 11:44:12 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-04-19 20:08:23 +0000
commitc2fdb4ecf3644015fa16e417c0939dd30f8b5a27 (patch)
tree13d691d97816b12fc49f2e5289f9855728c41719 /src/quickcontrols2/qquickstyleplugin.cpp
parente91e832f4a0a3ad820c07efd13e761881eeee790 (diff)
Merge QQuickPluginUtils to QQuickStylePlugin
Now that we have a common base class for the plugins, we don't need a separate utils namespace. QQuickStylePlugin::typeUrl() is based on the former QQuickPluginUtils::pluginBasePath(). It returns a URL to the internal composite types that must be explicitly registered for static builds. Change-Id: Icf28c27c84f6b58b1e7b34203dad39c852f0d362 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/quickcontrols2/qquickstyleplugin.cpp')
-rw-r--r--src/quickcontrols2/qquickstyleplugin.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp
index 1235b34c..7f6e1323 100644
--- a/src/quickcontrols2/qquickstyleplugin.cpp
+++ b/src/quickcontrols2/qquickstyleplugin.cpp
@@ -78,4 +78,20 @@ QQuickProxyTheme *QQuickStylePlugin::createTheme() const
return nullptr;
}
+/*
+ Returns either a file system path if Qt was built as shared libraries,
+ or a QRC path if Qt was built statically.
+*/
+QUrl QQuickStylePlugin::typeUrl(const QString &name) const
+{
+#ifdef QT_STATIC
+ QString url = QLatin1String("qrc") + baseUrl().path();
+#else
+ QString url = baseUrl().toString();
+#endif
+ if (!name.isEmpty())
+ url += QLatin1Char('/') + name;
+ return QUrl(url);
+}
+
QT_END_NAMESPACE