scene->setSceneRect(0, 0, 600, 600);
ui.map_view->setScene(scene);
scene->addRect(*r, targetPen, targetBrush);
r->setRect(200, 200, 300, 300);
scene->update(scene->itemsBoundingRect());
QGraphicsScene *scene = new QGraphicsScene();
scene->setSceneRect(0, 0, 600, 600);
ui.map_view->setScene(scene);
QRectF *r = new QRectF(0, 0, 100, 100);
scene->addRect(*r, targetPen, targetBrush);
r->setRect(200, 200, 300, 300);
scene->update(scene->itemsBoundingRect());
To copy to clipboard, switch view to plain text mode
Bookmarks