diff options
author | Alexader Karaivanov <Alexader.Karaivanov@gmail.com> | 2010-03-10 11:42:39 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-10 12:21:12 (GMT) |
commit | 9bba92715d96939e4d36c6ea42e8b466756bf891 (patch) | |
tree | 1817c734c193105f5db8ab29a50217bc922dfd86 /src/qt3support | |
parent | 960ff0590e99b28bc72d3aa104794bfa13eda2e5 (diff) | |
download | Qt-9bba92715d96939e4d36c6ea42e8b466756bf891.zip Qt-9bba92715d96939e4d36c6ea42e8b466756bf891.tar.gz Qt-9bba92715d96939e4d36c6ea42e8b466756bf891.tar.bz2 |
Fixes Q3ListViewItem grandchildren not sorted if item has one child
Q3ListViewItem::sortChildItems() used to exits early if there is only 1 child
item and leaves grandchildren unsorted.
Merge-request: 2260
Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/qt3support')
-rw-r--r-- | src/qt3support/itemviews/q3listview.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qt3support/itemviews/q3listview.cpp b/src/qt3support/itemviews/q3listview.cpp index 12dad84..4900827 100644 --- a/src/qt3support/itemviews/q3listview.cpp +++ b/src/qt3support/itemviews/q3listview.cpp @@ -1324,8 +1324,15 @@ void Q3ListViewItem::sortChildItems(int column, bool ascending) const int nColumns = (listView() ? listView()->columns() : 0); // and don't sort if we already have the right sorting order - if (column > nColumns || childItem == 0 || childItem->siblingItem == 0) + if (column > nColumns || childItem == 0) return; + + // If there is just one child, just sort its children + if (childItem->siblingItem == 0) { + if (childItem->isOpen()) + childItem->sortChildItems(column, ascending); + return; + } // make an array for qHeapSort() Q3ListViewPrivate::SortableItem * siblings |