summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kreuzkamp <anton.kreuzkamp@kdab.com>2019-02-21 10:29:51 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2019-02-22 12:04:40 +0000
commitcb836badcd8e0b2b2fcb6467cd3b9f7a5b8370b7 (patch)
treed9fedd5e7608a36e5d968ad4b09ceff22a430d98
parent458d04d46364643e4874a0f7022f0c3474350377 (diff)
Always load scene2d render plugin in static builds
Scene2d requires support from the Qt3D renderer, which is implemented in form of a renderer plugin. The renderer plugin is implicitly loaded when the scene2d module is loaded, through use of Q_COREAPP_STARTUP_FUNCTION, which does not support static builds, though. This change adds code to initialize the scene2d render plugin to the constructor of QScene2D, so that the first QScene2D object created will initialize the renderer plugin. Task-number: QTBUG-72378 Change-Id: I6f625e79a5be9f5a23dcc881f9b360382008032b Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/quick3d/quick3dscene2d/items/qscene2d.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick3d/quick3dscene2d/items/qscene2d.cpp b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
index 06e9eecd4..ef06f39f1 100644
--- a/src/quick3d/quick3dscene2d/items/qscene2d.cpp
+++ b/src/quick3d/quick3dscene2d/items/qscene2d.cpp
@@ -36,6 +36,7 @@
#include "qscene2d.h"
#include "qscene2d_p.h"
+#include <private/qrenderaspect_p.h>
#include "scene2d_p.h"
#include "scene2dmanager_p.h"
#include "scene2devent_p.h"
@@ -205,6 +206,12 @@ void QScene2DPrivate::setScene(Qt3DCore::QScene *scene)
QScene2D::QScene2D(Qt3DCore::QNode *parent)
: Qt3DCore::QNode(*new QScene2DPrivate, parent)
{
+#ifdef QT_STATIC
+ static bool isInitialized = false;
+ if (!isInitialized) {
+ Qt3DRender::QRenderAspectPrivate::configurePlugin(QLatin1String("scene2d"));
+ }
+#endif
}
/*!