diff options
| author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-15 18:04:36 +0300 |
|---|---|---|
| committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-16 08:47:20 +0000 |
| commit | 6e3fd69409849bc4803b104a7674139fa630eec5 (patch) | |
| tree | 94c5ed626eb2e45049b9c701aacffa370b582d25 /src/layouts/qquickstacklayout.cpp | |
| parent | fa1ff822b779c2d649517a5fefef81af8affaa68 (diff) | |
Replace foreach with range-based for
Change-Id: Ieb9019b62696479a4e0317a590bceaeb30abf62c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/layouts/qquickstacklayout.cpp')
| -rw-r--r-- | src/layouts/qquickstacklayout.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/layouts/qquickstacklayout.cpp b/src/layouts/qquickstacklayout.cpp index 66513bfdc..0785c502b 100644 --- a/src/layouts/qquickstacklayout.cpp +++ b/src/layouts/qquickstacklayout.cpp @@ -188,7 +188,8 @@ int QQuickStackLayout::indexOf(QQuickItem *childItem) const { if (childItem) { int indexOfItem = 0; - foreach (QQuickItem *item, childItems()) { + const auto items = childItems(); + for (QQuickItem *item : items) { if (shouldIgnoreItem(item)) continue; if (childItem == item) @@ -201,7 +202,8 @@ int QQuickStackLayout::indexOf(QQuickItem *childItem) const QQuickItem *QQuickStackLayout::itemAt(int index) const { - foreach (QQuickItem *item, childItems()) { + const auto items = childItems(); + for (QQuickItem *item : items) { if (shouldIgnoreItem(item)) continue; if (index == 0) @@ -214,7 +216,8 @@ QQuickItem *QQuickStackLayout::itemAt(int index) const int QQuickStackLayout::itemCount() const { int count = 0; - foreach (QQuickItem *item, childItems()) { + const auto items = childItems(); + for (QQuickItem *item : items) { if (shouldIgnoreItem(item)) continue; ++count; |
