how can i sort by myself when i click the header? on QTreeWidget
-
when i setSortingEnabled(true), i can click the header, and it will sort ascending or descengding, but it's just sort by the name, and do not care anything else.
how can i sort by myself when i click the header?
i want to sort by the name on basis of the item type(eg, dir, and files).
thank you
-
@opengpu2 You can subclass
QTreeWidgetItem
and create your own item. Then re-implement operator< and return true or false depending upon your conditions.
-
is there any demos?
should i re-implement operator< , operator>....and anything else?