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/folderlistmodel/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/folderlistmodel/plugin.cpp')
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index 7280fcd1dc..33c1167719 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -36,6 +36,13 @@ #include "qquickfolderlistmodel.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_Qt_labs_folderlistmodel); +#endif +} + QT_BEGIN_NAMESPACE //![class decl] @@ -45,6 +52,7 @@ class QmlFolderListModelPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QmlFolderListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); |