summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/mainwindow
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow')
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp7
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.cpp3
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 240a04c897..4e4c15ccaf 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -454,8 +454,8 @@ void ColorSwatch::updateContextMenu()
tabMenu->clear();
splitHMenu->clear();
splitVMenu->clear();
- QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
- foreach (ColorSwatch *dock, dock_list) {
+ const QList<ColorSwatch *> dockList = mainWindow->findChildren<ColorSwatch*>();
+ for (const ColorSwatch *dock : dockList) {
tabMenu->addAction(dock->objectName());
splitHMenu->addAction(dock->objectName());
splitVMenu->addAction(dock->objectName());
@@ -464,7 +464,8 @@ void ColorSwatch::updateContextMenu()
static ColorSwatch *findByName(const QMainWindow *mainWindow, const QString &name)
{
- foreach (ColorSwatch *dock, mainWindow->findChildren<ColorSwatch*>()) {
+ const QList<ColorSwatch *> dockList = mainWindow->findChildren<ColorSwatch*>();
+ for (ColorSwatch *dock : dockList) {
if (name == dock->objectName())
return dock;
}
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
index 096d3df5a8..36d4108b1e 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
@@ -244,7 +244,8 @@ void ToolBar::order()
{
QList<QAction *> ordered;
QList<QAction *> actions1 = actions();
- foreach (QAction *action, findChildren<QAction *>()) {
+ const QList<QAction *> childActions = findChildren<QAction *>();
+ for (QAction *action : childActions) {
if (!actions1.contains(action))
continue;
actions1.removeAll(action);