Hello,
how can I save and restore the columns' widths of a QTableView? Basically, I want to store them in my QSettings and restore them on program start.

I already have the working code for saving and restoring the geometry of a QDialog, but it does not work for a QTableView.

I tried both:

Qt Code:
  1. myTableView->saveGeometry()
To copy to clipboard, switch view to plain text mode 
and
Qt Code:
  1. myTableView->horizontalHeader()->saveGeometry()
To copy to clipboard, switch view to plain text mode 

but then, when I call restoreGeometry() in the QTableView constructor, nothing happens.

Thank you