diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2011-11-24 21:21:28 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-25 14:37:02 +0100 |
commit | c1007112c867d979ffd969d74c6aab10d4bc9474 (patch) | |
tree | 1e14fc712a24b9ce0cfb6c97a9f1b694f74dca0f /src | |
parent | f9e17f2a3222c5a979c8c7bdf16a5a4b14a4d22d (diff) |
Be specific about what part of the model is being re-layouted.
Change-Id: I6b6fe98929543447f945a335c33960823c0d1a4a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/itemviews/qsortfilterproxymodel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qsortfilterproxymodel.cpp b/src/widgets/itemviews/qsortfilterproxymodel.cpp index 4810d6e0fe..f8d5dcb302 100644 --- a/src/widgets/itemviews/qsortfilterproxymodel.cpp +++ b/src/widgets/itemviews/qsortfilterproxymodel.cpp @@ -1155,8 +1155,10 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc } if (!source_rows_resort.isEmpty()) { - // Re-sort the rows - emit q->layoutAboutToBeChanged(); + // Re-sort the rows of this level + QList<QPersistentModelIndex> parents; + parents << q->mapFromSource(source_parent); + emit q->layoutAboutToBeChanged(parents); QModelIndexPairList source_indexes = store_persistent_indexes(); remove_source_items(m->proxy_rows, m->source_rows, source_rows_resort, source_parent, Qt::Vertical, false); @@ -1164,7 +1166,7 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc insert_source_items(m->proxy_rows, m->source_rows, source_rows_resort, source_parent, Qt::Vertical, false); update_persistent_indexes(source_indexes); - emit q->layoutChanged(); + emit q->layoutChanged(parents); // Make sure we also emit dataChanged for the rows source_rows_change += source_rows_resort; } |