summaryrefslogtreecommitdiffstats
path: root/examples/quick/quickwidgets/quickwidget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/quickwidgets/quickwidget/main.cpp')
-rw-r--r--examples/quick/quickwidgets/quickwidget/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/main.cpp b/examples/quick/quickwidgets/quickwidget/main.cpp
index 6bb6722e02..7cb35d7bcd 100644
--- a/examples/quick/quickwidgets/quickwidget/main.cpp
+++ b/examples/quick/quickwidgets/quickwidget/main.cpp
@@ -133,7 +133,8 @@ void MainWindow::quickWidgetStatusChanged(QQuickWidget::Status status)
{
if (status == QQuickWidget::Error) {
QStringList errors;
- foreach (const QQmlError &error, m_quickWidget->errors())
+ const auto widgetErrors = m_quickWidget->errors();
+ for (const QQmlError &error : widgetErrors)
errors.append(error.toString());
statusBar()->showMessage(errors.join(QStringLiteral(", ")));
}