aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-07 18:07:43 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-08 09:16:20 +0000
commit9e0e47ffdbde58ec6ae3031c479d416e6e3ea174 (patch)
tree24c71d23bc65c72239bfec92db0e73365849d6fd /src
parentf0c0e00c1bfbd28b05f781070b5a0b6a73caf32d (diff)
Make QQuickWidget update inside a proxy widget
Performance will be bad but this allows having simple scenes in a QQuickWidget embedded into a QGraphicsView (ouch). This kind of setup is strongly discouraged but QWidget already has the readback-based fallback for render(), so we only need to add the update re-routing to the proxy widget. Task-number: QTBUG-49724 Change-Id: I1c80cb0a7b401327304ec7b92c77dc654d843b33 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src')
-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 1703ba1199..c97d747189 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()