I have a QTabWidget
and second page containing a QGraphicsView
with scene. The scene canvas is larger than the QGraphicsView's viewport and I'm using QScrollBar
to move objects on the scene.
On the scene I place a lot of QGraphicsItem objects. I have a horizontal and a vertical scroll bar, and some items can move only horizontally, another objects on scene can move only vertically.
My QGraphicsview
coordinates start at the top left corner of QGraphicsview
. After moving objects on the scene, if I change the page of the QTabWidget from second page to first and then back again, the start of coordinates is moved to the center of QGraphicsView, and all objects on the scene are moved to new positions automatically.
This happens only when I'm using a QTabWidget
, if I change the parent of QGraphicsView to QWidget, all works well.