From 1b897195a14b63a553b139983736d8dfdd419ffd Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 20 Jun 2016 16:56:52 +0200 Subject: 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 --- src/quickwidgets/qquickwidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); } -- cgit v1.2.3