Reputation: 442
I have two custom QML components, inherited from QDeclarativeItem
.
In constructors of my components I set this options:
setFlag(QGraphicsItem::ItemHasNoContents, false);
setCacheMode(QGraphicsItem::ItemCoordinateCache);
In my application I have an element of one type above an element of another type. This elements don't share any properties, but when one of them is redrawing, the another is redrawing too.
If I put some standard element above my elements (like a Text
or Rectangle
) and change it's properties, it doesn't make my elements redrawn. So I suppose, I've forgot to set some flag in my components.
How to prevent redrawing of one item when another is changing?
I'm using Qt 4.8 and QtQuick 1.1
Upvotes: 1
Views: 293
Reputation: 98425
In any raster-based rendering system, the drawing is done on a backing store buffer. Thus, when anything changes in a QGraphicsView
, all items that are not fully obscured must be drawn in back-to-front Z order. If any visible item changes, then all visible items that intersect it must be redrawn.
What you're seeing looks like normal behavior. Unless you provide some code, it's impossible to tell otherwise.
Upvotes: 1