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/window/plugin.cpp | |
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/window/plugin.cpp')
-rw-r--r-- | src/imports/window/plugin.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp index 010e9b3eed..2946cae679 100644 --- a/src/imports/window/plugin.cpp +++ b/src/imports/window/plugin.cpp @@ -35,6 +35,13 @@ #include <private/qquickwindowmodule_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_Window_2); +#endif +} + QT_BEGIN_NAMESPACE /*! @@ -53,13 +60,13 @@ QT_BEGIN_NAMESPACE */ - //![class decl] class QtQuick2WindowPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: + QtQuick2WindowPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window")); |