setSceneRect( QRectF() );
connect(this,&QGraphicsScene::changed,this,&BaScene::onChanged);void BaScene::onChanged(const QList<QRectF> &){ QRectF rect = itemsBoundingRect(); setSceneRect(rect);}