From c1007112c867d979ffd969d74c6aab10d4bc9474 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 24 Nov 2011 21:21:28 +0100 Subject: Be specific about what part of the model is being re-layouted. Change-Id: I6b6fe98929543447f945a335c33960823c0d1a4a Reviewed-by: Olivier Goffart --- src/widgets/itemviews/qsortfilterproxymodel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 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; } -- cgit v1.2.3