diff options
| author | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-03-01 12:53:29 +0100 |
|---|---|---|
| committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-03-15 13:58:59 +0000 |
| commit | b4c13916ec0fd7796acdf0ec5a1db0134479b3f2 (patch) | |
| tree | e2c5beb07d1da652af48e045c6899739bedef3d2 /src/extras/Styles/Flat/flatstyleplugin.cpp | |
| parent | a275fb3d29d5560af22ef5c4a721ce9bf2a2ccc1 (diff) | |
Enable using the module in a statically built application
Task-number: QTBUG-35754
Task-number: QTBUG-45868
Change-Id: I9bb332bc85713a17f02f3e7e768592e3234edfe3
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/extras/Styles/Flat/flatstyleplugin.cpp')
| -rw-r--r-- | src/extras/Styles/Flat/flatstyleplugin.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/extras/Styles/Flat/flatstyleplugin.cpp b/src/extras/Styles/Flat/flatstyleplugin.cpp index d9a30d347..5d88134bc 100644 --- a/src/extras/Styles/Flat/flatstyleplugin.cpp +++ b/src/extras/Styles/Flat/flatstyleplugin.cpp @@ -47,9 +47,14 @@ static void initResources() { +#ifndef QT_STATIC Q_INIT_RESOURCE(flatstyle); +#else + Q_INIT_RESOURCE(qmake_QtQuick_Controls_Styles_Flat); +#endif } +#ifndef QT_STATIC extern "C" { Q_DECL_EXPORT bool qt_quick_controls_style_init() { @@ -62,19 +67,23 @@ extern "C" { return ":/ExtrasImports/QtQuick/Controls/Styles/Flat"; } } +#endif QT_BEGIN_NAMESPACE QtQuickExtrasStylesPlugin::QtQuickExtrasStylesPlugin(QObject *parent) : QQmlExtensionPlugin(parent) { + initResources(); } void QtQuickExtrasStylesPlugin::registerTypes(const char *uri) { - initResources(); - - const QString prefix = "qrc:/ExtrasImports/QtQuick/Controls/Styles/Flat/"; +#ifndef QT_STATIC + const QString prefix = "qrc:///ExtrasImports/QtQuick/Controls/Styles/Flat/"; +#else + const QString prefix = "qrc:/qt-project.org/imports/QtQuick/Controls/Styles/Flat/"; +#endif // register version 1.0 qmlRegisterSingletonType(QUrl(prefix + "FlatStyle.qml"), uri, 1, 0, "FlatStyle"); qmlRegisterType(QUrl(prefix + "ApplicationWindowStyle.qml"), uri, 1, 0, "ApplicationWindowStyle"); |
