From df39627fa33392a71ab79aadaa57e5c5e650e79e Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Tue, 1 Jan 2019 15:18:57 +0100 Subject: Examples: cleanup foreach usage Replace deprecated foreach macro with range-based for loop Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38 Reviewed-by: Paul Wicking --- examples/corelib/threads/queuedcustomtype/window.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/corelib/threads') diff --git a/examples/corelib/threads/queuedcustomtype/window.cpp b/examples/corelib/threads/queuedcustomtype/window.cpp index 2cefba1e17..0d3f80aba4 100644 --- a/examples/corelib/threads/queuedcustomtype/window.cpp +++ b/examples/corelib/threads/queuedcustomtype/window.cpp @@ -89,9 +89,10 @@ Window::Window() void Window::loadImage() { QStringList formats; - foreach (QByteArray format, QImageReader::supportedImageFormats()) + const QList supportedFormats = QImageReader::supportedImageFormats(); + for (const QByteArray &format : supportedFormats) if (format.toLower() == format) - formats.append("*." + format); + formats.append(QLatin1String("*.") + QString::fromLatin1(format)); QString newPath = QFileDialog::getOpenFileName(this, tr("Open Image"), path, tr("Image files (%1)").arg(formats.join(' '))); -- cgit v1.2.3