osiris81
29th March 2010, 10:12
Hi,
I'm using several QTreeWidgets and activated now the setSortingEnabled. I have some problems with that function:
- when I enable the sorting, the widgets sorts automatically the first column in descending(!) order, why that? Can I change at least the default sort order to ascendng order?
- How can I remove the sorting so the normal order (the order I inserted the elements) is visible again?
- What would be the easiest way to sort a column that has text and numbers, it should sort the numbers like 1, 5, 10, 20 and not 1, 10, 20, 5
I do not want to use QTreeView and implement my own models because the QTreeWidget is already used in many places and I do not want to change all that code.
Thanks for any answer!
Cheers,
Rico
I'm using several QTreeWidgets and activated now the setSortingEnabled. I have some problems with that function:
- when I enable the sorting, the widgets sorts automatically the first column in descending(!) order, why that? Can I change at least the default sort order to ascendng order?
- How can I remove the sorting so the normal order (the order I inserted the elements) is visible again?
- What would be the easiest way to sort a column that has text and numbers, it should sort the numbers like 1, 5, 10, 20 and not 1, 10, 20, 5
I do not want to use QTreeView and implement my own models because the QTreeWidget is already used in many places and I do not want to change all that code.
Thanks for any answer!
Cheers,
Rico