summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-01 12:05:33 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-01 10:30:45 +0000
commite648611e6d64891f1723a0e32c783c8d5f994de1 (patch)
treec40b1e72fb927dae02badb472d0f77cef73e70d8
parent6138e25290908372620e9d2ae70893b1b7ae3e08 (diff)
downloadqtquickcontrols-e648611e6d64891f1723a0e32c783c8d5f994de1.tar.gz
Fix Qt Quick Extras plugin when built against Qt with namespaces
Q_INIT_RESOURCES declares an external symbols, and if therefore Q_INIT_RESOURCES is within a namespace, it will also think that declared symbol has to be in the namespace. However our rcc generated symbols are in the global namespace, so that's also from where we need to call Q_INIT_RESOURCES. Task-number: QTBUG-46393 Change-Id: Id3b5f4fbf561724811e3e9aec7d37def20903ea7 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
-rw-r--r--src/extras/plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/extras/plugin.cpp b/src/extras/plugin.cpp
index 87455eb1..fb37d5d3 100644
--- a/src/extras/plugin.cpp
+++ b/src/extras/plugin.cpp
@@ -45,6 +45,11 @@
#include "Private/qquickmousethief_p.h"
#include "Private/qquickmathutils_p.h"
+static void initResources()
+{
+ Q_INIT_RESOURCE(extras);
+}
+
QT_BEGIN_NAMESPACE
static QObject *registerMathUtilsSingleton(QQmlEngine *engine, QJSEngine *jsEngine)
@@ -61,7 +66,7 @@ QtQuickExtrasPlugin::QtQuickExtrasPlugin(QObject *parent) :
void QtQuickExtrasPlugin::registerTypes(const char *uri)
{
- Q_INIT_RESOURCE(extras);
+ initResources();
const QString prefix = "qrc:///ExtrasImports/QtQuick/Extras";
// Register public API.
qmlRegisterUncreatableType<QQuickActivationMode>(uri, 1, 0, "ActivationMode", QLatin1String("Do not create objects of type ActivationMode"));