From 199962af4d107c5681c1601298195069dc437ecc Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 8 Apr 2016 12:32:03 +0200 Subject: Use the pluginBasePath() to get the right base path for the configuration Using pluginBasePath() ensures that it finds the qml files in the expected place so it needs to use this to work correctly when statically built. Change-Id: I685a98efc284a7c7d2b6a182f269a09e381a3472 Reviewed-by: Andy Shaw Reviewed-by: Mitch Curtis --- src/imports/controls/material/qtquickmaterialstyleplugin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/imports/controls/material/qtquickmaterialstyleplugin.cpp') diff --git a/src/imports/controls/material/qtquickmaterialstyleplugin.cpp b/src/imports/controls/material/qtquickmaterialstyleplugin.cpp index a0336226..821a9a65 100644 --- a/src/imports/controls/material/qtquickmaterialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickmaterialstyleplugin.cpp @@ -42,6 +42,7 @@ #include "qquickmaterialprogressstrip_p.h" #include +#include static inline void initResources() { @@ -82,13 +83,15 @@ void QtQuickMaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char { QQuickStylePlugin::initializeEngine(engine, uri); + const QString pluginBasePath = QQuickPluginUtils::pluginBasePath(*this); + QByteArray import = QByteArray(uri) + ".impl"; qmlRegisterType(import, 1, 0, "ProgressRing"); qmlRegisterType(import, 1, 0, "ProgressStrip"); qmlRegisterType(import, 1, 0, "RingAnimator"); qmlRegisterType(import, 1, 0, "StripAnimator"); - qmlRegisterType(QUrl(baseUrl().toString() + QStringLiteral("/Ripple.qml")), import, 1, 0, "Ripple"); - qmlRegisterType(QUrl(baseUrl().toString() + QStringLiteral("/SliderHandle.qml")), import, 1, 0, "SliderHandle"); + qmlRegisterType(QUrl(pluginBasePath + QStringLiteral("/Ripple.qml")), import, 1, 0, "Ripple"); + qmlRegisterType(QUrl(pluginBasePath + QStringLiteral("/SliderHandle.qml")), import, 1, 0, "SliderHandle"); } QString QtQuickMaterialStylePlugin::name() const -- cgit v1.2.3