aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-06-20 16:56:52 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-06-27 11:59:45 +0000
commit1b897195a14b63a553b139983736d8dfdd419ffd (patch)
tree8b57a43600fd0c1736795caa33c47eb88dc6800b
parent188b160dd0f9959ea01647e07478254e928e3411 (diff)
Fix missing QQuickWidget updates
Having an animated QQuickFramebufferObject inside a QQuickWidget is currently broken due to losing update requests. The problems are introduced in 4b4cf31c7a4bcb89cabca09102c4e0a22ab0c6b1 where we may erroneously reset the updatePending false even though there may be an active triggerUpdate ticking via the 5 ms update timer. Task-number: QTBUG-54239 Change-Id: If84af8ec9c992761cfef9049de642a943f91cfe6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/quickwidgets/qquickwidget.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 7f869c6ba5..39f7b6c3d3 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -1103,7 +1103,14 @@ void QQuickWidget::showEvent(QShowEvent *)
d->createContext();
if (d->offscreenWindow->openglContext()) {
d->render(true);
- if (d->updatePending) {
+ // render() may have led to a QQuickWindow::update() call (for
+ // example, having a scene with a QQuickFramebufferObject::Renderer
+ // calling update() in its render()) which in turn results in
+ // renderRequested in the rendercontrol, ending up in
+ // triggerUpdate. In this case just calling update() is not
+ // acceptable, we need the full renderSceneGraph issued from
+ // timerEvent().
+ if (!d->eventPending && d->updatePending) {
d->updatePending = false;
update();
}