summaryrefslogtreecommitdiff
path: root/examples/svg/svgviewer
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-06 17:54:23 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-13 19:58:19 +0000
commit74bc4617dd5a38abb60aff8b252001cb2ff9c7b8 (patch)
tree8368a44500af57a0880d89b47ddc73f9b38d6530 /examples/svg/svgviewer
parent4c44cffd7b376900fc41169365ae03c7c65d95b6 (diff)
downloadqtsvg-74bc4617dd5a38abb60aff8b252001cb2ff9c7b8.tar.gz
Eradicate Q_FOREACH loops and mark the module as Q_FOREACH-free
In BearerCloud::timerEvent(), bite the bullet and use a std::vector instead of a QList to avoid repeated qAsConst() applications. In BearerCloud::configurationRemoved() and configurationChanged(), instead of iterating over QMultiMap::uniqueKeys() and QMap::remove(), iterate directly over the QMultiMap and remove the desired elements. Cache a QString. In BearerCloud::updateConfigurations(), instead of using while !isEmpty() takeFirst() on a local copy of a QList, simply iterate over the QList (now made const) using C++11 ranged for. In tst_QSvgGenerator, replace a QList of statically-known size with a C array. Change-Id: Ic0dd1c67d0819fe6167f2bce248f9b910be65803 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/svg/svgviewer')
-rw-r--r--examples/svg/svgviewer/exportdialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/svg/svgviewer/exportdialog.cpp b/examples/svg/svgviewer/exportdialog.cpp
index 04c9e12..b7cb96a 100644
--- a/examples/svg/svgviewer/exportdialog.cpp
+++ b/examples/svg/svgviewer/exportdialog.cpp
@@ -195,7 +195,8 @@ void ExportDialog::browse()
if (!fileName.isEmpty())
fileDialog.setDirectory(QFileInfo(fileName).absolutePath());
QStringList mimeTypes;
- foreach (const QByteArray &mimeType, QImageWriter::supportedMimeTypes())
+ const auto supportedMimeTypes = QImageWriter::supportedMimeTypes();
+ for (const QByteArray &mimeType : supportedMimeTypes)
mimeTypes.append(QLatin1String(mimeType));
fileDialog.setMimeTypeFilters(mimeTypes);
const int pngIndex = mimeTypes.indexOf("image/png");