pstudio
31st January 2010, 01:45
Hey,
I've just started looking into Qt 4.6.1 (and I'm liking it :)) and I want to create a little vector graphics based program as an exercise.
I've subclassed QGraphicsScene so when you press left mouse button, it simply adds a QGraphicsPolygonItem. When such an item is added to the scene, the associated QGraphicsView automatically adjusts its view, so that all the items are centered. This may be a neat feature in some cases, but in this case it's just confusing, if the view always adjust itself when adding new items.
I've tried looking in the documentation and on the Diagram Scene example that comes with Qt Creator, but I can't find out how to prevent the QGraphicsView from automatically adjusting its view.
Any help would be appreciated.
Btw. I used Qt designer to create the form with QGraphicsView if that makes a difference.
I've just started looking into Qt 4.6.1 (and I'm liking it :)) and I want to create a little vector graphics based program as an exercise.
I've subclassed QGraphicsScene so when you press left mouse button, it simply adds a QGraphicsPolygonItem. When such an item is added to the scene, the associated QGraphicsView automatically adjusts its view, so that all the items are centered. This may be a neat feature in some cases, but in this case it's just confusing, if the view always adjust itself when adding new items.
I've tried looking in the documentation and on the Diagram Scene example that comes with Qt Creator, but I can't find out how to prevent the QGraphicsView from automatically adjusting its view.
Any help would be appreciated.
Btw. I used Qt designer to create the form with QGraphicsView if that makes a difference.