diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-05 10:49:56 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-05 15:34:15 +0200 |
commit | 4eba90c9228423c82729c8678b9737ecf79974d7 (patch) | |
tree | b0056deb8828467eea20732a2fb90d39ff122266 /src/widgets/graphicsview | |
parent | 7db59f458b96342f762a0bd9f5218907c026019a (diff) |
QGraphicsGridLayout: simplify a loop over Qt::Orientation values
Instead of selecting a Qt::Orientation value based on the integer loop
variable, just loop over the possible Qt::Orientation values directly.
Change-Id: I25b6f0d49c9b5a7e16e974dcc37668f801e65224
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsgridlayout.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicsgridlayout.cpp b/src/widgets/graphicsview/qgraphicsgridlayout.cpp index 260e1861c7..79cba74a93 100644 --- a/src/widgets/graphicsview/qgraphicsgridlayout.cpp +++ b/src/widgets/graphicsview/qgraphicsgridlayout.cpp @@ -587,9 +587,7 @@ void QGraphicsGridLayout::removeAt(int index) d->engine.removeItem(gridItem); // recalculate rowInfo.count if we remove an item that is on the right/bottommost row - for (int j = 0; j < NOrientations; ++j) { - // 0: Hor, 1: Ver - const Qt::Orientation orient = (j == 0 ? Qt::Horizontal : Qt::Vertical); + for (const Qt::Orientation orient : {Qt::Horizontal, Qt::Vertical}) { const int oldCount = d->engine.rowCount(orient); if (gridItem->lastRow(orient) == oldCount - 1) { const int newCount = d->engine.effectiveLastRow(orient) + 1; |