Unsolved radio Button Sorting in QTableWidget
-
My table has first column as text and next three column as radioButton how can I sort the next RadioButton if they are clicked and corresponding directory. Please find the attached pic of my ui![alt text]
-
How do you implement those radio buttons?
(please don't say
setItemWidget
, it just hurts more every time I see it) -
@MarshMallow said in radio Button Sorting in QTableWidget:
My table has first column as text and next three column as radioButton how can I sort the next RadioButton if they are clicked and corresponding directory.
- subclass a QSortFilterProxyModel and wrap it around your existing model and assign this model to your view
- reimplement it's lessThan() method
- implement the logic for your columns, call the base class implementation for irrelevant columns
- call sort() on the proxy model
Also see this