You can determine visible area in the scene coordinates as follows:
QRect viewport_rect(0, 0, view->viewport()->width(), view->viewport()->height());
QRectF visible_scene_rect = view->mapToScene(viewport_rect).boundingRect();
You can use QGraphicsItem::mapFromScene
to convert scene coordinates to item coordinates is necessary.
You can use view->horizontalScrollBar()
and view->verticalScrollBar()
to obtain QScrollBar*
objects. Connect to valueChanged(int)
signal of these objects to track scrolling.