diff options
author | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-06-20 01:26:48 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-12-02 12:20:32 +0000 |
commit | ec5a886d4b92a18669d5bbd01b43a57f7d81b856 (patch) | |
tree | 688305c899ce01c73b8a3cf94d825f4fddc5642a /src/imports/statemachine | |
parent | c3a818d19e34e08e0759dedce18d9daa5ba7d94e (diff) |
Utilize the resources when building statically.
This is needed so that the qmldir file is picked up correctly when using a
static build of the plugins in the application as this gets taken care of
automatically by qmake. The Q_INIT_RESOURCES line itself is only needed
statically because no resource file is needed for dynamic libraries so it
is protected with the QT_STATIC define.
Task-number: QTBUG-35754
Change-Id: I9059e10c0846548f365fe4f95dd9c6100eeb43cd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/imports/statemachine')
-rw-r--r-- | src/imports/statemachine/plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp index 4a711a3278..e0fea01d8f 100644 --- a/src/imports/statemachine/plugin.cpp +++ b/src/imports/statemachine/plugin.cpp @@ -41,6 +41,13 @@ #include <QQmlExtensionPlugin> #include <qqml.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQml_StateMachine); +#endif +} + QT_BEGIN_NAMESPACE class QtQmlStateMachinePlugin : public QQmlExtensionPlugin @@ -49,6 +56,7 @@ class QtQmlStateMachinePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtQml.StateMachine/1.0") public: + QtQmlStateMachinePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } void registerTypes(const char *uri) { qmlRegisterType<State>(uri, 1, 0, "State"); |