PDA

View Full Version : graphics view architecture



qtcentreforum
15th February 2011, 08:28
How can I put graphics items in different layers so that items can be viewed selectively by
simply enabling/disabling the layers. Also how some layers can be drawn frequently and some
drawn infrequently and some drawn only once i.e. selective layer draw.

Example:
1.Background map is static information thus has to be drawn only once.

2.Target information coming from LAN is dynamic and gets updated frequently and different types of targets have to be drawn in different layers so that the operator can view one type of targets using layer selection.

I am using Graphics View Framework of Qt 4.7.

szisziszilvi
15th February 2011, 12:25
I'm not sure if this separate paint can be done on a graphicsview item. I'm just thinking on the fact that when the data changes so eg. a curve changes than new areas get visible from the background and otherd get hidden so the backgroung should be also redrawn. Better qualified people, please let me know if I'm wrong.

for the layers: I would try to use classes for the implementation of a layer in which maybe a boolean variable could be a solution, and in the paint function there should be an if statement before doing anything. Connecting its "setVisible()" to some proper signals or slots should work. Well, this idea was not really detailful, I know, but I would start working on this line.

(please note I'm just an innocent but curious beginner... :))