diff options
Diffstat (limited to 'src/widgets/itemviews/qsortfilterproxymodel.cpp')
-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; } |