diff options
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 4 | ||||
-rw-r--r-- | src/network/access/qnetworkdiskcache.cpp | 17 | ||||
-rw-r--r-- | src/widgets/itemviews/qcolumnview.cpp | 5 |
3 files changed, 6 insertions, 20 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index d473f3df9f..6219252161 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -685,9 +685,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) t << _slnGlobalBeg; - QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs); - while (extraIt.hasNext()) { - extraIt.next(); + for (auto extraIt = extraSubdirs.cbegin(), end = extraSubdirs.cend(); extraIt != end; ++extraIt) { for (const QString &depend : extraIt.value()) { if (!projGuids[depend].isEmpty()) { extraIt.key()->dependencies << projGuids[depend]; diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index eb66a1a6a4..5d38ebcd86 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -114,11 +114,7 @@ QNetworkDiskCache::QNetworkDiskCache(QObject *parent) QNetworkDiskCache::~QNetworkDiskCache() { Q_D(QNetworkDiskCache); - QHashIterator<QIODevice*, QCacheItem*> it(d->inserting); - while (it.hasNext()) { - it.next(); - delete it.value(); - } + qDeleteAll(d->inserting); } /*! @@ -319,13 +315,11 @@ bool QNetworkDiskCache::remove(const QUrl &url) Q_D(QNetworkDiskCache); // remove is also used to cancel insertions, not a common operation - QHashIterator<QIODevice*, QCacheItem*> it(d->inserting); - while (it.hasNext()) { - it.next(); + for (auto it = d->inserting.cbegin(), end = d->inserting.cend(); it != end; ++it) { QCacheItem *item = it.value(); if (item && item->metaData.url() == url) { delete item; - d->inserting.remove(it.key()); + d->inserting.erase(it); return true; } } @@ -559,10 +553,7 @@ qint64 QNetworkDiskCache::expire() QFile file(name); if (name.contains(PREPARED_SLASH)) { - QHashIterator<QIODevice*, QCacheItem*> iterator(d->inserting); - while (iterator.hasNext()) { - iterator.next(); - QCacheItem *item = iterator.value(); + for (QCacheItem *item : qAsConst(d->inserting)) { if (item && item->file && item->file->fileName() == name) { delete item->file; item->file = 0; diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp index bc8a9d38d8..cba7e8aacc 100644 --- a/src/widgets/itemviews/qcolumnview.cpp +++ b/src/widgets/itemviews/qcolumnview.cpp @@ -793,11 +793,8 @@ void QColumnView::initializeColumn(QAbstractItemView *column) const column->setModel(model()); // Copy the custom delegate per row - QMapIterator<int, QPointer<QAbstractItemDelegate> > i(d->rowDelegates); - while (i.hasNext()) { - i.next(); + for (auto i = d->rowDelegates.cbegin(), end = d->rowDelegates.cend(); i != end; ++i) column->setItemDelegateForRow(i.key(), i.value()); - } // set the delegate to be the columnview delegate QAbstractItemDelegate *delegate = column->itemDelegate(); |