From 34e4a8ef6d20e829a322bfef1d09136a37fecfd2 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 7 Dec 2018 12:01:42 +0100 Subject: Cleanup Widgets examples - foreach Cleanup the Widgets examples - replace foreach with range-based for loop in the remaining directories Change-Id: I321e6c0f414401a1ae4fb65762b97d894b725afa Reviewed-by: Paul Wicking Reviewed-by: Luca Beldi --- examples/widgets/doc/src/diagramscene.qdoc | 2 +- examples/widgets/doc/src/orderform.qdoc | 2 +- examples/widgets/doc/src/plugandpaint.qdoc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/widgets/doc/src') diff --git a/examples/widgets/doc/src/diagramscene.qdoc b/examples/widgets/doc/src/diagramscene.qdoc index ca4876f2e8d..860dcc5cb93 100644 --- a/examples/widgets/doc/src/diagramscene.qdoc +++ b/examples/widgets/doc/src/diagramscene.qdoc @@ -589,7 +589,7 @@ \snippet graphicsview/diagramscene/diagramscene.cpp 14 The scene has single selection, i.e., only one item can be - selected at any given time. The foreach will then loop one time + selected at any given time. The for loop will then loop one time with the selected item or none if no item is selected. \c isItemChange() is used to check whether a selected item exists and also is of the specified diagram \a type. diff --git a/examples/widgets/doc/src/orderform.qdoc b/examples/widgets/doc/src/orderform.qdoc index de59fc402d5..5c63081a779 100644 --- a/examples/widgets/doc/src/orderform.qdoc +++ b/examples/widgets/doc/src/orderform.qdoc @@ -191,7 +191,7 @@ We then set the \c{cursor}'s position back to its last position in \c topFrame and fill in the customer's name (provided by the constructor) - and address - using a \c foreach loop to traverse the QString, \c address. + and address - using a range-based for loop to traverse the QString, \c address. \snippet richtext/orderform/mainwindow.cpp 4 diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc index d3044860ab5..b37176da0e1 100644 --- a/examples/widgets/doc/src/plugandpaint.qdoc +++ b/examples/widgets/doc/src/plugandpaint.qdoc @@ -171,8 +171,8 @@ \snippet tools/plugandpaint/app/mainwindow.cpp 8 We use QDir::entryList() to get a list of all files in that - directory. Then we iterate over the result using \l foreach and - try to load the plugin using QPluginLoader. + directory. Then we iterate over the result using a range-based for loop + and try to load the plugin using QPluginLoader. The QObject provided by the plugin is accessible through QPluginLoader::instance(). If the dynamic library isn't a Qt -- cgit v1.2.3