PDA

View Full Version : Problem with QGraphicsView.



kiranraj
4th July 2007, 11:29
In main window application, when i use scrollbar to scroll to some GraphicsView area of a scene, iam facing one issue.
When the application is minimized and then maximized, the scrollbar does not stay at the last view position. Rather it shifts to the left and top extremes.

Iam are not sure how to overcome this problem. I want the restore to retain the last Scene coordinates.

Thanx

Bitto
4th July 2007, 19:44
Have you tried recentering them manually? You could do something like this:



/* QPointF */ lastCenterPoint = view->mapToScene(view->rect().center());
// minimize...


// restore...
view->scrollTo(lastCenterPoint);


Or, you could simply store the scrollbar values before and restore them after the minimize. I guess you have multiple options here.