[Qt-qml] QML and graphics item caching

Adriano Rezende adriano.rezende at openbossa.org
Fri Sep 3 17:05:32 CEST 2010


> the screen on each frame of the animation. Doesn't setting
> QGraphicsItem::NoCache do exactly this (blit a cached bitmap instead
> of calling draw on each child item)?

No, ItemCoordinateCache only caches the item, not it's children.

> 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?

AFAIK cacheMode is not exposed in QML side. But for what you want
there is not official support even in QGraphicsView side.
There was an idea to implement a DeepItemCacheMode that would do
exactly this, but it was forgotten and never saw the daylight.

I think this would be a great feature also. You could set a complex
element into a frozen state to do more fancy transformations without
having to apply transformations in each child behind the scenes.

Br,
Adriano



More information about the Qt-qml mailing list