diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 20:03:28 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 20:03:28 (GMT) |
commit | 5783f98ce5e243afbbd4c6a68c80d2dd959520e0 (patch) | |
tree | a3de3aadcae6c4c956c75ea7bdf8d44e2b18c452 /src/gui/itemviews | |
parent | e0a50a627376a7b83a2e965dee75515ed283a447 (diff) | |
parent | 7b96944a02991e404cdab61e24182b90f5849120 (diff) | |
download | Qt-5783f98ce5e243afbbd4c6a68c80d2dd959520e0.zip Qt-5783f98ce5e243afbbd4c6a68c80d2dd959520e0.tar.gz Qt-5783f98ce5e243afbbd4c6a68c80d2dd959520e0.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
QSortFilterProxyModel: Fix dynamic sorting when severals rows are added.
QLabel: add setSelection, hasSelectedText, selectedText, selectionStart.
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qsortfilterproxymodel.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 472af7d..e73013c 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -270,6 +270,11 @@ void QSortFilterProxyModelPrivate::clear_mapping() qDeleteAll(source_index_mapping); source_index_mapping.clear(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } // update the persistent indexes update_persistent_indexes(source_indexes); @@ -1208,11 +1213,6 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged() void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() { Q_Q(QSortFilterProxyModel); - if (saved_persistent_indexes.isEmpty()) { - clear_mapping(); - emit q->layoutChanged(); - return; - } qDeleteAll(source_index_mapping); source_index_mapping.clear(); @@ -1220,7 +1220,11 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() update_persistent_indexes(saved_persistent_indexes); saved_persistent_indexes.clear(); - update_source_sort_column(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } emit q->layoutChanged(); } |