C++ (Qt)QRectF current_rect = scene->sceneRect();scene->setSceneRect( QRectF() );QRectF items_bounding_rect = scene->sceneRect();scene->setSceneRect( current_rect );