[Qt-interest] QGraphicsView: scalable and fixed items

Hendrik Fuß fuss at molecular-machines.com
Tue May 25 16:20:20 CEST 2010


Hi folks,

I was looking into using QGraphicsView for an application, but I wasn't sure if it could cope with the following:

In my application I need a number of graphics items which adjust to the view's zoom and viewport rectangle (world items). On top of that I have one or several layers of items which stay at their absolute (or relative) screen position (fixed items). I want the user to interact with (ie select, move, delete etc.) the fixed items as well as the world items.

I could of course override drawForeground() to render the fixed items, but I'd probably have to write all the interaction code for the fixed items myself, which kind of eliminates the benefits of using QGraphicsViews in the first place.

I'm not quite sure how to solve this. Can I have two QGraphicsViews on top of each other? Or a single QGraphicsView with multiple QGraphicsScenes? Or something else?

cheers
Hendrik




More information about the Qt-interest-old mailing list