aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-12-18 19:17:30 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-12-18 19:17:30 +0100
commit9f38956fc9a58a2fdfd83c91d65502964047eda3 (patch)
tree3156fa78c621e3588b230d8334944d4c9e857d45 /src/quickwidgets
parent57cd6337a87f4a8a77ea7136c60a32d2825426df (diff)
parent839d2d3e2368bc8e107d22203b0611c852f54319 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
Diffstat (limited to 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 6a29dea505..11e7953e93 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -252,8 +252,15 @@ void QQuickWidgetPrivate::renderSceneGraph()
}
Q_ASSERT(offscreenSurface);
+
render(true);
- q->update(); // schedule composition
+
+#ifndef QT_NO_GRAPHICSVIEW
+ if (q->window()->graphicsProxyWidget())
+ QWidgetPrivate::nearestGraphicsProxyWidget(q)->update();
+ else
+#endif
+ q->update(); // schedule composition
}
QImage QQuickWidgetPrivate::grabFramebuffer()
@@ -717,12 +724,13 @@ void QQuickWidgetPrivate::createContext()
context = new QOpenGLContext;
context->setFormat(offscreenWindow->requestedFormat());
- if (qt_gl_global_share_context())
- context->setShareContext(qt_gl_global_share_context());
- else
- context->setShareContext(QWidgetPrivate::get(q->window())->shareContext());
- context->setScreen(context->shareContext()->screen());
-
+ QOpenGLContext *shareContext = qt_gl_global_share_context();
+ if (!shareContext)
+ shareContext = QWidgetPrivate::get(q->window())->shareContext();
+ if (shareContext) {
+ context->setShareContext(shareContext);
+ context->setScreen(shareContext->screen());
+ }
if (!context->create()) {
const bool isEs = context->isOpenGLES();
delete context;
@@ -1220,6 +1228,7 @@ bool QQuickWidget::event(QEvent *e)
}
break;
+ case QEvent::Show:
case QEvent::Move:
d->updatePosition();
break;