diff options
author | David Skoland <david.skoland@qt.io> | 2020-10-06 18:11:26 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-17 11:56:30 +0200 |
commit | 4a7280598b99379425043a8773dd274e5bcb24d5 (patch) | |
tree | 58e431ba1a8d2a2c062de98fbfea6faf135387f3 /src/widgets/graphicsview | |
parent | b61d67f897bcf4cb11f08b322ed97bf12988f741 (diff) |
Fix Clang compiler warnings (-Wrange-loop-analysis)
In a macOS environment, Clang throws a number of compiler warnings
about loop variables when building qtbase.
See task for more info about the environment.
This changes a handful of loop variables,
like QJsonValue references into QJsonValueRefs.
Task-number: QTBUG-87216
Pick-to: 5.15
Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 53e72ab542..4880e316e2 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -4420,7 +4420,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte QRegion pixmapExposed; QRectF exposedRect; if (!itemCache->allExposed) { - for (const auto rect : qAsConst(itemCache->exposed)) { + for (const auto &rect : qAsConst(itemCache->exposed)) { exposedRect |= rect; pixmapExposed += itemToPixmap.mapRect(rect).toAlignedRect(); } @@ -4580,7 +4580,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte // Map the item's logical expose to pixmap coordinates. QRegion pixmapExposed = scrollExposure; if (!itemCache->allExposed) { - for (const auto rect : qAsConst(itemCache->exposed)) + for (const auto &rect : qAsConst(itemCache->exposed)) pixmapExposed += itemToPixmap.mapRect(rect).toRect().adjusted(-1, -1, 1, 1); } @@ -4589,7 +4589,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte if (itemCache->allExposed) { br = item->boundingRect(); } else { - for (const auto rect : qAsConst(itemCache->exposed)) + for (const auto &rect : qAsConst(itemCache->exposed)) br |= rect; QTransform pixmapToItem = itemToPixmap.inverted(); for (const QRect &r : qAsConst(scrollExposure)) |