Set up an OpenGL Context to be shared between threads beforehand

Allows for plugins that depend on Qt WebEngine module.
This commit is contained in:
denchat 2020-02-10 10:48:37 +07:00 committed by GitHub
parent 9cdf76a9a2
commit 249c75b993

View File

@ -884,6 +884,15 @@ int main( int argc, char *argv[] )
QCoreApplication::setAttribute( Qt::AA_DisableWindowContextHelpButton, true );
#endif
// Set up an OpenGL Context to be shared between threads beforehand
// for plugins that depend on Qt WebEngine module.
// As suggested by Qt documentation at:
// - https://doc.qt.io/qt-5/qtwebengine.html
// - https://code.qt.io/cgit/qt/qtwebengine.git/plain/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
#if defined(QT_OS_WIN) && !defined(QT_NO_OPENGL) && (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) )
QCoreApplication::setAttribute( Qt::AA_ShareOpenGLContexts, true );
#endif
// Set up the QgsSettings Global Settings:
// - use the path specified with --globalsettingsfile path,
// - use the environment if not found