aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-10-09 11:09:51 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-10-18 14:18:05 +0200
commit4080025fed9d43a78b578bcab67397712459d28c (patch)
treeed2194df9e14a653fd052e0726f2d689030dbbe3 /src
parent4876b0b60a92cd028a821c7c1c095ed55fb15f68 (diff)
Set the screen on the QOpenGLContext to be the same as the windowv5.13.2
This ensures that the QOpenGLContext has the right screen information and can create a compatible context for use with QQuickWidget. Change-Id: I9d78ff2b616e5c1d1c11d1da438ce336a0f24953 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quickwidgets/qquickwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index b63f7de9f1..55c095af8e 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -878,7 +878,9 @@ void QQuickWidgetPrivate::createContext()
context = new QOpenGLContext;
context->setFormat(offscreenWindow->requestedFormat());
-
+ const QWindow *win = q->window()->windowHandle();
+ if (win && win->screen())
+ context->setScreen(win->screen());
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext)
shareContext = QWidgetPrivate::get(q->window())->shareContext();