diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-09 12:52:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-09 15:52:05 +0000 |
commit | 10e7d4aaa499d9a046f794b96a0caffeb3271f1a (patch) | |
tree | 3cc5157813f29433902b7203f26a93841648c93a | |
parent | 7cd9447e14159be90a5fdb927a4a3ed2cbff50b2 (diff) |
Fix use of OpenGL scenegraph in static builds
Make sure the resources are initialized when the default QSG context is
in use, and not just when QML is used.
Change-Id: I581906bf59cf4ea07505c8ad9e15f2833f727ca2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/quick/qtquick2.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultcontext.cpp | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp index 24467a3701..63f3b91b82 100644 --- a/src/quick/qtquick2.cpp +++ b/src/quick/qtquick2.cpp @@ -55,11 +55,6 @@ #include <qqmlproperty.h> #include <QtCore/QPointer> -static void initResources() -{ - Q_INIT_RESOURCE(scenegraph); -} - QT_BEGIN_NAMESPACE #if !QT_CONFIG(qml_debug) @@ -185,8 +180,6 @@ void QQmlQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *ob void QQmlQtQuick2Module::defineModule() { - initResources(); - QQuick_initializeProviders(); QQuickUtilModule::defineModule(); diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index 9a0ac66690..1124bf1727 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -290,3 +290,10 @@ QSGRendererInterface::ShaderSourceTypes QSGDefaultContext::shaderSourceType() co } QT_END_NAMESPACE + +static void initResources() +{ + Q_INIT_RESOURCE(scenegraph); +} + +Q_CONSTRUCTOR_FUNCTION(initResources) |