diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-25 18:32:46 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-26 10:37:07 +0200 |
commit | 2a390bb481a2433a239a9198e463c9337a26db59 (patch) | |
tree | 8c8661482ab497a97fb557fad63fc748c10d4d5d /src/gui/itemviews/qsortfilterproxymodel.cpp | |
parent | 5839b16a73c36ff7636c13f841d26e6a5e0c5435 (diff) |
Fixed: QSortFilterProxyModel setDynamicSortFilter doesn't works when setting the model initially
This was caused by two different bug:
- In the QSortFilterProxyModel, we need to re-sort when setting the
source model change the sorting column (happen when setting a model
initially)
- In the treeview, we need to activate the sorting even if there is no
column yet (because the initial model is empty
Task-number: 254234
Reviewed-by: Thierry
BT:
Diffstat (limited to 'src/gui/itemviews/qsortfilterproxymodel.cpp')
-rw-r--r-- | src/gui/itemviews/qsortfilterproxymodel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 43feda84b2..92dfd19a00 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -1518,7 +1518,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel) d->clear_mapping(); reset(); - d->update_source_sort_column(); + if (d->update_source_sort_column() && d->dynamic_sortfilter) + d->sort(); } /*! |