[Development] QtQuick 2 offscreen rendering

André Bergner andre.bergner.0 at googlemail.com
Tue Mar 18 10:12:35 CET 2014


Hi all,

for a project we use QML/QtQuick2 to render two separate offscreen views
for an application. We are currently still on Qt 5.1 and use a somehow
hacky solution to accomplish that goal, which is we create a QWindow and
set it immediately after its creation to hidden. We add two QQuickViews as
children, set their renderTargets to a frame buffer object, and grab its
content in the QQuickView::afterRendering step. This works so far for Mac
and Windows. The reason for this hack is that without adding the
QQuickViews to the hidden QWindow parent they won't receive any update
events and nothing will be drawn. On Windows the parent QWindow is
sometimes visible for a split second, which is not nice.

We now are facing the problem that this hack does not work anymore on
windows when we update to Qt 5.2. Besides from that this solution is not
pretty anyways.

So what is the "official" way to render a QQuickView scene to an offscreen
target while keeping it "alive"?

I remember talking to somebody at the last Qt dev days in Berlin. He was
suggesting some solution that should make this possible with Qt 5.2.

Best,
André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140318/f251ff76/attachment.html>


More information about the Development mailing list