When I set the scene rect to the same rect of the viewport:
mCanvasScene->setSceneRect(mCanvasView->viewport()->rect());
The QGraphicsView
creates scrollbars in the widget, but if the scene is the same size of the viewport why there are scrollbars ? It seems that the rect()
from the viewport isn’t the correct size of the viewport area.
Does anyone knows how to set the scene with the same size of the visible area of the viewport ?
view->scene()->setSceneRect(view->viewport()->rect());
I get no scrollbars. – thuga