| 143 | void GraphicsView::zoomFit() { fitInView(scene()->itemsBoundingRect(), false); } |
| 144 | |
| 145 | void GraphicsView::zoomToSelected() |
| 146 | { |
| 147 | QRectF rect; |
| 148 | for (const QGraphicsItem* item : scene()->selectedItems()) { |
| 149 | const QRectF tmpRect(item->pos().isNull() ? item->boundingRect() : item->boundingRect().translated(item->pos())); |
| 150 | rect = /*rect.isEmpty() ? tmpRect :*/ rect.united(tmpRect); |
| 151 | } |
| 152 | if (rect.isEmpty()) |
| 153 | return; |
| 154 | fitInView(rect); |
| 155 | } |
| 156 | |
| 157 | void GraphicsView::zoom100() |
| 158 | { |
no test coverage detected