summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorStephen Kelly <stephen@kdab.com>2010-03-18 15:41:00 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-18 15:41:00 (GMT)
commite884829f23fad15086f07aa92e1d92bcb71d53ba (patch)
tree5b08e7cae546bb48e94f285203c729bda6ecd7e1 /src/gui/itemviews
parent5f9cf976110a0847053f1104376ad8831f9ceb48 (diff)
downloadQt-e884829f23fad15086f07aa92e1d92bcb71d53ba.zip
Qt-e884829f23fad15086f07aa92e1d92bcb71d53ba.tar.gz
Qt-e884829f23fad15086f07aa92e1d92bcb71d53ba.tar.bz2
Fix bug when resetting QSortFilterProxyModel
If multiple proxies are connected to one source model which gets reset, the order of execution of the sourceModelAboutToBeReset slots could cause QPersistentModelIndexes to be invalidated in one proxy model before the same slot is executed in the other proxy model. Additionally, the persistent indexes in the QSFPM are invalidated before the persistent indexes in the source model. This patch makes them invalidated afterward now, which makes more sense. Merge-request: 503 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index c6ad345..dce5c6a 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1217,13 +1217,13 @@ void QSortFilterProxyModelPrivate::_q_sourceAboutToBeReset()
{
Q_Q(QSortFilterProxyModel);
q->beginResetModel();
- invalidatePersistentIndexes();
- clear_mapping();
}
void QSortFilterProxyModelPrivate::_q_sourceReset()
{
Q_Q(QSortFilterProxyModel);
+ invalidatePersistentIndexes();
+ clear_mapping();
// All internal structures are deleted in clear()
q->endResetModel();
update_source_sort_column();