Reputation: 1185
Imagine QGraphicsView
is set with the scene that is twice as wider as view's width. sceneRect()
will return the whole scene rect. I'd like to get the rect representing the half of the scene with respect to scrollbars' positions.
Upvotes: 1
Views: 1248
Reputation: 2210
Get the viewport rectangle with the graphicsView->viewport()->rect()
and map it to the scene space with the graphicsView->mapToScene()
.
Upvotes: 1
Reputation: 9156
I am not totally sure which rectangle you exactly need (this depends from what you want to do) but something like graphicsView->viewport()->contentsRect()
or graphicsView->viewport()->geometry()
should work.
Upvotes: 0