diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-25 16:32:46 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-26 08:37:07 (GMT) |
commit | 2a390bb481a2433a239a9198e463c9337a26db59 (patch) | |
tree | 8c8661482ab497a97fb557fad63fc748c10d4d5d /src/gui/itemviews/qheaderview.cpp | |
parent | 5839b16a73c36ff7636c13f841d26e6a5e0c5435 (diff) | |
download | Qt-2a390bb481a2433a239a9198e463c9337a26db59.zip Qt-2a390bb481a2433a239a9198e463c9337a26db59.tar.gz Qt-2a390bb481a2433a239a9198e463c9337a26db59.tar.bz2 |
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/qheaderview.cpp')
-rw-r--r-- | src/gui/itemviews/qheaderview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index dc63b25..86ece40 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1267,8 +1267,10 @@ void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order) d->sortIndicatorSection = logicalIndex; d->sortIndicatorOrder = order; - if (logicalIndex >= d->sectionCount) + if (logicalIndex >= d->sectionCount) { + emit sortIndicatorChanged(logicalIndex, order); return; // nothing to do + } if (old != logicalIndex && ((logicalIndex >= 0 && resizeMode(logicalIndex) == ResizeToContents) |