I currently have a tableview attached to a class that is derived from QSortFilterProxyModel. Now I wanted to know if there is any way by which I can store the order of columns since the users tend to move the columns back and forth. Also is there any signal that is emitted when a user changes the order of the columns.I search this but I cannot find anything that might tel me when a column is moved around and how i can save the tablew columns orders. Any suggetsions would be appreciated
You need to obtain a QHeaderView
object using QTableView::horizontalHeader
. You can use QHeaderView::saveState
and QHeaderView::restoreState
to save state of columns. You can use QHeaderView::sectionMoved
signal to detect column moving.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With