summaryrefslogtreecommitdiffstats
path: root/src/qt3support/itemviews/q3listview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt3support/itemviews/q3listview.cpp')
-rw-r--r--src/qt3support/itemviews/q3listview.cpp9
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