summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsurfaceformat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qsurfaceformat.cpp')
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 4d2dcab924a..59c469ae6b6 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -9,6 +9,10 @@
#include <QtGui/qcolorspace.h>
#include <QtGui/qguiapplication.h>
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qopenglcontext_p.h>
+#endif
+
#ifdef major
#undef major
#endif
@@ -807,12 +811,6 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format)
and surfaces, even the ones created internally by Qt, will use the same
format.
- \note When setting Qt::AA_ShareOpenGLContexts, it is strongly recommended to
- place the call to this function before the construction of the
- QGuiApplication or QApplication. Otherwise \a format will not be applied to
- the global share context and therefore issues may arise with context sharing
- afterwards.
-
\since 5.4
\sa defaultFormat()
*/
@@ -820,7 +818,7 @@ void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format)
{
#ifndef QT_NO_OPENGL
if (qApp) {
- QOpenGLContext *globalContext = QOpenGLContext::globalShareContext();
+ QOpenGLContext *globalContext = qt_gl_global_share_context();
if (globalContext && globalContext->isValid()) {
qWarning("Warning: Setting a new default format with a different version or profile "
"after the global shared context is created may cause issues with context "