diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-01-02 17:09:54 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-01-10 12:30:19 +0000 |
commit | 5a1ce04cb71263ab078921f5efc8cf30f95a2eb5 (patch) | |
tree | c0c4119ab225a0031f4c7a4ac8af8f625c44a0bd /examples | |
parent | 86515f2a650c8e6acc6906d5308061c8cd064408 (diff) | |
download | qtactiveqt-5a1ce04cb71263ab078921f5efc8cf30f95a2eb5.tar.gz |
Remove foreach
Use range based for.
Change-Id: If91077be5bb13aa1447866c4243511db72d4f46c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/activeqt/webbrowser/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/activeqt/webbrowser/main.cpp b/examples/activeqt/webbrowser/main.cpp index cac2505..869ddfc 100644 --- a/examples/activeqt/webbrowser/main.cpp +++ b/examples/activeqt/webbrowser/main.cpp @@ -78,7 +78,7 @@ static QList<Location> defaultBookmarks() static bool containsAddress(const QList<Location> &locations, const QString &address) { - foreach (const Location &location, locations) { + for (const Location &location : locations) { if (location.address == address) return true; } @@ -195,7 +195,7 @@ MainWindow::MainWindow() QList<Location> bookmarks = readBookMarks(settings); if (bookmarks.isEmpty() || restoredVersion.isEmpty()) bookmarks = defaultBookmarks(); - foreach (const Location &bookmark, bookmarks) + for (const Location &bookmark : qAsConst(bookmarks)) addBookmark(bookmark); } @@ -222,7 +222,7 @@ QAction *MainWindow::addLocation(const Location &location, QMenu *menu) QList<Location> MainWindow::bookmarks() const { QList<Location> result; - foreach (const QAction *action, bookmarkActions) + for (const QAction *action : qAsConst(bookmarkActions)) result.append(locationFromAction(action)); return result; } |