From 5a1ce04cb71263ab078921f5efc8cf30f95a2eb5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 2 Jan 2017 17:09:54 +0100 Subject: Remove foreach Use range based for. Change-Id: If91077be5bb13aa1447866c4243511db72d4f46c Reviewed-by: Joerg Bornemann --- examples/activeqt/webbrowser/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') 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 defaultBookmarks() static bool containsAddress(const QList &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 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 MainWindow::bookmarks() const { QList result; - foreach (const QAction *action, bookmarkActions) + for (const QAction *action : qAsConst(bookmarkActions)) result.append(locationFromAction(action)); return result; } -- cgit v1.2.1