summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index ca55f2e..92f8816 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2209,8 +2209,7 @@ QPolygonF QGraphicsView::mapToScene(const QRect &rect) const
QPointF br = scrollOffset + r.bottomRight();
QPointF bl = scrollOffset + r.bottomLeft();
- QPolygonF poly;
- poly.resize(4);
+ QPolygonF poly(4);
if (!d->identityMatrix) {
QTransform x = d->matrix.inverted();
poly[0] = x.map(tl);
@@ -2313,8 +2312,7 @@ QPolygon QGraphicsView::mapFromScene(const QRectF &rect) const
br -= scrollOffset;
bl -= scrollOffset;
- QPolygon poly;
- poly.resize(4);
+ QPolygon poly(4);
poly[0] = tl.toPoint();
poly[1] = tr.toPoint();
poly[2] = br.toPoint();
@@ -3647,8 +3645,7 @@ QRectF QGraphicsViewPrivate::mapToScene(const QRectF &rect) const
QPointF br = scrollOffset + rect.bottomRight();
QPointF bl = scrollOffset + rect.bottomLeft();
- QPolygonF poly;
- poly.resize(4);
+ QPolygonF poly(4);
if (!identityMatrix) {
QTransform x = matrix.inverted();
poly[0] = x.map(tl);