summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2009-11-26 15:00:13 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-26 15:28:00 (GMT)
commit88b9c6eb3f1dde9997d5e824450c9eaa2a36f8d5 (patch)
tree44dcef8d9fa3dbbd4f115ccb3a6e16ab0b8494c1 /src/corelib
parent236d8ad3aedd09e905df97412380545d0986be2c (diff)
downloadQt-88b9c6eb3f1dde9997d5e824450c9eaa2a36f8d5.zip
Qt-88b9c6eb3f1dde9997d5e824450c9eaa2a36f8d5.tar.gz
Qt-88b9c6eb3f1dde9997d5e824450c9eaa2a36f8d5.tar.bz2
Don't crash via proxy model when moving QModelIndexes
The layoutAboutToBeChanged signal gives proxies a chance to persist QModelIndexes. The d->itemsAboutToBeMoved method is part of the process of moving the persistent indexes. d->itemsAboutToBeMoved must be called after layoutAboutToBeChanged. Otherwise persistent indexes will not be updated. Merge-request: 2219 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 10a61ca..9335085 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2546,9 +2546,9 @@ bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sour
int destinationLast = destinationChild + (sourceLast - sourceFirst);
d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
- d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
emit rowsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
emit layoutAboutToBeChanged();
+ d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
return true;
}