summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-06-04 12:08:57 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2018-06-06 06:10:38 +0000
commit542c5b698cb9586aac48cc4dda66a6a2f98c905e (patch)
treeedfdde1de98e132e6cb7bf4445638ed8f7ce8f3a /examples
parent6cd3360c4d5283893eeb1efe43e329073709b48c (diff)
Use range-based for instead of Q_FOREACH
Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webengine/quicknanobrowser/main.cpp2
-rw-r--r--examples/webenginewidgets/spellchecker/webview.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/webengine/quicknanobrowser/main.cpp b/examples/webengine/quicknanobrowser/main.cpp
index 94d6f851..b1b80106 100644
--- a/examples/webengine/quicknanobrowser/main.cpp
+++ b/examples/webengine/quicknanobrowser/main.cpp
@@ -66,7 +66,7 @@ static QUrl startupUrl()
QUrl ret;
QStringList args(qApp->arguments());
args.takeFirst();
- Q_FOREACH (const QString& arg, args) {
+ for (const QString &arg : qAsConst(args)) {
if (arg.startsWith(QLatin1Char('-')))
continue;
ret = Utils::fromUserInput(arg);
diff --git a/examples/webenginewidgets/spellchecker/webview.cpp b/examples/webenginewidgets/spellchecker/webview.cpp
index 833d8106..a65fb1a1 100644
--- a/examples/webenginewidgets/spellchecker/webview.cpp
+++ b/examples/webenginewidgets/spellchecker/webview.cpp
@@ -89,7 +89,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (profile->isSpellCheckEnabled()) {
QMenu *subMenu = menu->addMenu(tr("Select Language"));
- foreach (const QString &str, m_spellCheckLanguages.keys()) {
+ const QStringList keys = m_spellCheckLanguages.keys();
+ for (const QString &str : keys) {
QAction *action = subMenu->addAction(str);
action->setCheckable(true);
QString lang = m_spellCheckLanguages[str];