is there a way to disable interaction or just sorting for a specific row in a QTreeWidget
? I have a table where if you click the header, it sorts the items. I have a custom "CTreeWidgetItem
" where I have overloaded the < operator
to perform a custom sort on my data. The problem is, it sorts on every header I click, not just the first column. I need it to only work for the first column. Is there something I can do?
Asked
Active
Viewed 761 times
0

ulak blade
- 2,515
- 5
- 37
- 81
1 Answers
1
Simply connect to the sectionClicked()
signal of the header (QTreeView::header()
). Then force the sort indicator back to the first section QHeaderView::setSortIndicator()
.

Tfry
- 194
- 6