diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-01 15:18:57 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-02 12:49:19 +0000 |
commit | df39627fa33392a71ab79aadaa57e5c5e650e79e (patch) | |
tree | 83a776716c9b8d9bea2e0a5c3282aa5e0cbcdb6d /examples/corelib/threads/queuedcustomtype | |
parent | 7847e6bc02552fa7fc7f518e5cb3336f667b5a6d (diff) |
Examples: cleanup foreach usage
Replace deprecated foreach macro with range-based for loop
Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/corelib/threads/queuedcustomtype')
-rw-r--r-- | examples/corelib/threads/queuedcustomtype/window.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<QByteArray> 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(' '))); |