Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
When I have items in a QGraphicsScene, if they exist outside the viewport, I get scrollbars automatically.
How can I force programmatically, scroll all the way to the right or left?
This might help: Using your QGraphicsView::horizontalScrollBar() you can try:
QGraphicsView::horizontalScrollBar()
view->horizontalScrollBar()->setValue( view->horizontalScrollBar()->maximum() );
This would bring you to the right. If you want to the left, use minimum() instead.
minimum()
I would say it is function of graphicsView, not scene. Check void QGraphicsView::centerOn ( const QPointF & pos ). Also scrollbar functionality is limited to max int. I would not rely on it.
Thank you both, both approaches seem to generally work.