| 270 | } |
| 271 | |
| 272 | QRectF GraphicsView::getViewRect() |
| 273 | { |
| 274 | QPointF topLeft(horizontalScrollBar()->value(), verticalScrollBar()->value()); |
| 275 | QPointF bottomRight(topLeft + viewport()->rect().bottomRight()); |
| 276 | |
| 277 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) |
| 278 | QRectF visible_scene_rect(matrix().inverted().mapRect({ topLeft, bottomRight })); |
| 279 | #else |
| 280 | QRectF visible_scene_rect(transform().inverted().mapRect({ topLeft, bottomRight })); |
| 281 | #endif |
| 282 | |
| 283 | return visible_scene_rect; |
| 284 | } |
| 285 | |
| 286 | void GraphicsView::wheelEvent(QWheelEvent* event) |
| 287 | { |