QGraphicsScene in QGraphics view Scroll bar issues
-
Hello,
I have a QGraphicsScene bigger than the QGraphicsView I am setting the scene in.
So, by default, it adds scroll bars, vertical and horizontal in my case.
The issue I have is that the scene is centered into the view and the scroll bars initial positions are in the middle on X axis and Y axis.
I would like that on the X axis, the scroll bar is at the extreme left instead of in the middle. How could I do that?Thanks
-
You can use "Scroll":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#scrollhttp://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#scroll function to scroll to desired points, which would be 0 for x position to set scrollbar to extreme left.
-
Thank you it works ! Once thing strange still is that when I do :
ui->graphicsViewS->horizontalScrollBar()->setSliderPosition( ui->graphicsViewS->horizontalScrollBar()->minimum());
it is also setting the minimum value for the verticalScrollBar ... Any idea why?