aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2019-02-22 23:53:30 +0700
committerTim Blechmann <tim@klingt.org>2019-02-23 00:01:10 +0700
commitc1663865e68d96d4a51351d4d1d2bfa5f313dc18 (patch)
tree177617dfcaf59327099eb6a5d1e7b0476abad4c9
parent850d037bd455f2d96b22825756ce136bbd681a6c (diff)
declarative: fix resource initialization for namespaced builds
`Q_INIT_RESOURCE` cannot be used from within a Qt namespace. so we move the `Q_INIT_RESOURCE` call to static function defined on the global namespace Change-Id: I9eed7699e969369f861b95cdf3f7376ade73c1b3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/quickshapes/qquickshape.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp
index 262d0b3e9a..74cbf52a95 100644
--- a/src/quickshapes/qquickshape.cpp
+++ b/src/quickshapes/qquickshape.cpp
@@ -48,6 +48,13 @@
#include <QOpenGLFunctions>
#include <QLoggingCategory>
+#if defined(QT_STATIC)
+static void initResources()
+{
+ Q_INIT_RESOURCE(qtquickshapes);
+}
+#endif
+
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(QQSHAPE_LOG_TIME_DIRTY_SYNC, "qt.shape.time.sync")
@@ -662,7 +669,7 @@ struct QQuickShapeResourceInitializer
QQuickShapeResourceInitializer()
{
#if defined(QT_STATIC)
- Q_INIT_RESOURCE(qtquickshapes);
+ initResources();
#endif
}
};