From 9021639f41f8f45ed4f8b495cee85310638862c5 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 25 Feb 2015 15:16:13 +0100 Subject: [PATCH] Improve setDefaultFormat docs regarding AA_ShareOpenGLContexts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using core profile contexts, sharing with the global share context may not work if the global one is a non-core context. This can happen when setDefaultFormat() is called only after Q(Gui)Application is constructed. This is a typical issue on OS X, so document it. Change-Id: I6a8dca442ffeb884faedb9c6346351bb6eef3cff Reviewed-by: Sean Harmer Reviewed-by: Jørgen Lind --- src/gui/kernel/qsurfaceformat.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index 2fdfa3baf10..6ec13e92a1f 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -747,6 +747,12 @@ 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() */