GraphicsView: use range-based for instead of foreach
Change-Id: I8e1b50bcbffdb492dc10662150b51b0eed1e228e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
302a1bc7b7
commit
53f52edb2a
|
|
@ -2526,7 +2526,7 @@ QGraphicsAnchorLayoutPrivate::getGraphParts(Orientation orientation)
|
|||
|
||||
// Check if this constraint have some overlap with current
|
||||
// trunk variables...
|
||||
foreach (QSimplexVariable *ad, trunkVariables) {
|
||||
for (QSimplexVariable *ad : qAsConst(trunkVariables)) {
|
||||
if (c->variables.contains(ad)) {
|
||||
match = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -7308,7 +7308,7 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
selectedItems = d_ptr->scene->selectedItems();
|
||||
initialPositions = d_ptr->scene->d_func()->movingItemsInitialPositions;
|
||||
if (initialPositions.isEmpty()) {
|
||||
foreach (QGraphicsItem *item, selectedItems)
|
||||
for (QGraphicsItem *item : qAsConst(selectedItems))
|
||||
initialPositions[item] = item->pos();
|
||||
initialPositions[this] = pos();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6391,7 +6391,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
|
|||
ev.setWidget(event->widget());
|
||||
sendEvent(receiver.data(), &ev);
|
||||
QSet<QGesture *> ignoredGestures;
|
||||
foreach (QGesture *g, gestures) {
|
||||
for (QGesture *g : qAsConst(gestures)) {
|
||||
if (!ev.isAccepted() && !ev.isAccepted(g)) {
|
||||
// if the gesture was ignored by its target, we will update the
|
||||
// targetItems list with a possible target items (items that
|
||||
|
|
|
|||
|
|
@ -2703,7 +2703,7 @@ void QGraphicsView::updateScene(const QList<QRectF> &rects)
|
|||
dirtyViewportRects << xrect;
|
||||
}
|
||||
|
||||
foreach (const QRect &rect, dirtyViewportRects) {
|
||||
for (const QRect &rect : qAsConst(dirtyViewportRects)) {
|
||||
// Add the exposed rect to the update region. In rect update
|
||||
// mode, we only count the bounding rect of items.
|
||||
if (!boundingRectUpdate) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue