QGraphicsScene::clear doesn't change sceneRect
问题 I have a QGraphicsScene "scene" and QGraphicsView "graphicsView". I have a drawing method. When I need redraw all the graphics, I call this method. Everything is OK. But I realized that scene->clear() doesn't change the sceneRect. Also I tried: graphicsView->items().clear(); scene->clear(); graphicsView->viewport()->update(); After that, if I get the sceneRect by QRectF bound = scene->sceneRect(); qDebug() << bound.width(); qDebug() << bound.height(); I expect the bound.width and bound.height