From: Thiago Macieira Date: Thu, 24 May 2012 14:42:11 +0000 (+0200) Subject: Itemviews: compile with QT_STRICT_ITERATORS X-Git-Tag: 071012110112~787 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4fbe872be1316f2fd65aa62863d6617cb129a3f;p=profile%2Fivi%2Fqtbase.git Itemviews: compile with QT_STRICT_ITERATORS Just a few mixed up iterators. Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636 Reviewed-by: Stephen Kelly --- diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 68e5e89..875bb81 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -1114,7 +1114,7 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc if (!source_top_left.isValid() || !source_bottom_right.isValid()) return; QModelIndex source_parent = source_top_left.parent(); - IndexMap::const_iterator it = source_index_mapping.find(source_parent); + IndexMap::const_iterator it = source_index_mapping.constFind(source_parent); if (it == source_index_mapping.constEnd()) { // Don't care, since we don't have mapping for this index return; diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 30c3f03..ddec247 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -691,7 +691,7 @@ bool QSqlTableModel::submitAll() bool success = true; for (QSqlTableModelPrivate::CacheMap::Iterator it = d->cache.begin(); - it != d->cache.constEnd(); ++it) { + it != d->cache.end(); ++it) { if (it.value().submitted()) continue; diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 06733a8..ff92adb 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1142,7 +1142,7 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent QList > values; QHash::const_iterator iterator; int i = 0; - for(iterator = indexNode->children.begin() ; iterator != indexNode->children.end() ; ++iterator) { + for(iterator = indexNode->children.constBegin() ; iterator != indexNode->children.constEnd() ; ++iterator) { if (filtersAcceptsNode(iterator.value())) { values.append(QPair((iterator.value()), i)); } else { diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index d7e7cb3..147187d 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -2637,9 +2637,9 @@ void QIconModeViewBase::paintDragDrop(QPainter *painter) painter->translate(draggedItemsDelta()); QStyleOptionViewItemV4 option = viewOptions(); option.state &= ~QStyle::State_MouseOver; - QVector::const_iterator it = draggedItems.begin(); + QVector::const_iterator it = draggedItems.constBegin(); QListViewItem item = indexToListViewItem(*it); - for (; it != draggedItems.end(); ++it) { + for (; it != draggedItems.constEnd(); ++it) { item = indexToListViewItem(*it); option.rect = viewItemRect(item); delegate(*it)->paint(painter, option, *it); diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 510ae41..f2a2ef2 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -2020,14 +2020,14 @@ void QTreeView::doItemsLayout() //clean the QSet that may contains old (and this invalid) indexes d->hasRemovedItems = false; QSet::iterator it = d->expandedIndexes.begin(); - while (it != d->expandedIndexes.constEnd()) { + while (it != d->expandedIndexes.end()) { if (!it->isValid()) it = d->expandedIndexes.erase(it); else ++it; } it = d->hiddenIndexes.begin(); - while (it != d->hiddenIndexes.constEnd()) { + while (it != d->hiddenIndexes.end()) { if (!it->isValid()) it = d->hiddenIndexes.erase(it); else