summaryrefslogtreecommitdiffstats
path: root/examples/widgets/touch/fingerpaint/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/touch/fingerpaint/mainwindow.cpp')
-rw-r--r--examples/widgets/touch/fingerpaint/mainwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/touch/fingerpaint/mainwindow.cpp b/examples/widgets/touch/fingerpaint/mainwindow.cpp
index b0d91d25bf..2f7ec38d1a 100644
--- a/examples/widgets/touch/fingerpaint/mainwindow.cpp
+++ b/examples/widgets/touch/fingerpaint/mainwindow.cpp
@@ -129,7 +129,8 @@ void MainWindow::createActions()
openAct->setShortcut(tr("Ctrl+O"));
connect(openAct, &QAction::triggered, this, &MainWindow::open);
- foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
+ const QList<QByteArray> imageFormats = QImageWriter::supportedImageFormats();
+ for (const QByteArray &format : imageFormats) {
QString text = tr("%1...").arg(QString(format).toUpper());
QAction *action = new QAction(text, this);
@@ -163,8 +164,7 @@ void MainWindow::createMenus()
//! [15] //! [16]
{
saveAsMenu = new QMenu(tr("&Save As"), this);
- foreach (QAction *action, saveAsActs)
- saveAsMenu->addAction(action);
+ saveAsMenu->addActions(saveAsActs);
fileMenu = new QMenu(tr("&File"), this);
fileMenu->addAction(openAct);