Sort vertical headers QTableWidget

I have a QTableWidget that is used to display a large amount of data, mainly obtained from the function f (a, b) . All values ​​of a are included in the horizontal header, all values ​​of b in the vertical header and all f (a, b) in the corresponding cell.

Columns must be sortable. When the user clicks on a column, all values ​​in this column are sorted, and all other columns are also “synchronized”, since whole rows are sorted (using a column with a click as a sort criterion).

It works. Except for the “column heading,” the vertical heading. The vertical header does not change; it does not synchronize with the reorganized rows. Is this the intended behavior? Is this a bug in my code? How do I sort the vertical header? Or do I need to add my b to a regular column?

edit: I solved it now by making the header column a regular column. Although I will still be wondering why the vertical header is not sorted with other columns.

+5
source share
1 answer

QTableView QTableWidget.
QAbstractTableModel f (a, b)

+2

All Articles