From 4a7ccb65f0065e878c5762db05eca9c5cd6731e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 5 May 2025 14:35:48 +0200 Subject: Lazily create global share context when Qt::AA_ShareOpenGLContexts is set The requirement to set Qt::AA_ShareOpenGLContexts before creating QGuiApp was forcing users to also set the default surface format before QGuiApp, which prevents us from initializing a default surface format based on the platform integration. By creating the global share context lazily when requested via the Qt::AA_ShareOpenGLContext application attribute we open up this possibility. Change-Id: I958639c997e96321013b1080c31e2533a36c13ff Reviewed-by: Allan Sandfeld Jensen --- src/opengl/qopenglwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qopenglwindow.cpp') diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp index 6b74aaedd70..05330dda0a4 100644 --- a/src/opengl/qopenglwindow.cpp +++ b/src/opengl/qopenglwindow.cpp @@ -161,7 +161,7 @@ public: , shareContext(shareContext) { if (!shareContext) - this->shareContext = qt_gl_global_share_context(); + this->shareContext = QOpenGLContext::globalShareContext(); } ~QOpenGLWindowPrivate(); -- cgit v1.2.3