From ec5a886d4b92a18669d5bbd01b43a57f7d81b856 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 20 Jun 2015 01:26:48 +0200 Subject: 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 --- src/imports/testlib/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/imports/testlib') diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index c42ece5da5..b2ea10fa38 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -48,6 +48,13 @@ QML_DECLARE_TYPE(QuickTestEvent) #include +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtTest); +#endif +} + QT_BEGIN_NAMESPACE class QuickTestUtil : public QObject @@ -137,6 +144,7 @@ class QTestQmlModule : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QTestQmlModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest")); -- cgit v1.2.3