[Qt-qml] QML and graphics item caching

Juha Turunen turunen at iki.fi
Wed Jul 28 13:15:13 CEST 2010


Hi all,

I'm developing an app with a QML UI and targeting a mobile device
which I know to have pretty modest graphics performance.

Let's assume I have two views that fill the whole screen and I want to
animate between them by simply scrolling the new one in while the old
one scrolls out. The views are static during the transition. Obviously
the most efficient way to achieve this is to have two bitmaps that
contain and image of the states of both views and blit the bitmaps to
the screen on each frame of the animation. Doesn't setting
QGraphicsItem's cache mode to something else than
QGraphicsItem::NoCache do exactly this (blit a cached bitmap instead
of calling draw on each child item)?

Can I hint a QML Item element to temporarily cache itself for the
duration of the transition? Or should I derive a C++ class from
QDeclarativeItem that has a method to take a 'screenshot' of a QML
element and move an instance of it around when I need to scroll the
view?

Any input from people knowing the guts of QtDeclarative would be very
much appreciated.

- Juha



More information about the Qt-qml mailing list