Itemviews: compile with QT_STRICT_ITERATORS

Just a few mixed up iterators.

Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
bb10
Thiago Macieira 2012-05-24 16:42:11 +02:00 committed by Qt by Nokia
parent 576d4a1cce
commit c4fbe872be
5 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -1142,7 +1142,7 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
QList<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > values;
QHash<QString, QFileSystemNode *>::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<QFileSystemModelPrivate::QFileSystemNode*, int>((iterator.value()), i));
} else {

View File

@ -2637,9 +2637,9 @@ void QIconModeViewBase::paintDragDrop(QPainter *painter)
painter->translate(draggedItemsDelta());
QStyleOptionViewItemV4 option = viewOptions();
option.state &= ~QStyle::State_MouseOver;
QVector<QModelIndex>::const_iterator it = draggedItems.begin();
QVector<QModelIndex>::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);

View File

@ -2020,14 +2020,14 @@ void QTreeView::doItemsLayout()
//clean the QSet that may contains old (and this invalid) indexes
d->hasRemovedItems = false;
QSet<QPersistentModelIndex>::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