[Qt-interest] Graphics View Framework : Layers , Updates , Invalidates . How it works?????

Simone Artesino mlist.sa at gmail.com
Mon Aug 31 17:57:12 CEST 2009


Hi I've a question about the physical usage of layers.
I have the following situation : one image is in the
QGraphicsScene::BackgroundLayer , and two other ones are loaded in
different items (added to QGraphicsScene::ItemLayer) . This items are
overlapped in particular one has Z value of 3 while the other has 1.
We have cached the background layer (QGraphicsView::CacheBackground
on) and as result each time we invalidate the itemlayer the background
is rightly displayed. Furthermore we noticed that the
drawBackground(QPainter *painter, const QRectF &) function it's not
invoked anymore once the backgroundlayer is cached.

We would like to have the same behaviour with the two overlapped
items. is it possible? we tried use QGraphicsItem::CacheMode but we
obtain that the item paint function of the lower item it's still
invoked.
Is there any mode to map two item in two different physical layers? Or
there's a modality to repaint only one of the two item without cause
the repaint of the other one, maintaining the second one on the
screen????



More information about the Qt-interest-old mailing list