Users of my application are able to resize header's columns as they want.
And resized widths of columns are to save in QSettings to restore user's favorite size next time. But something wrong with next code, please help:

First of all, here is a part of constructor of MainWindow:
Qt Code:
  1. eveModel = new EveModel(this);
  2. header = tableView->horizontalHeader();
  3. proxyModel->setSourceModel(eveModel);
  4. proxyModel->setDynamicSortFilter(true);
  5. header->setResizeMode(QHeaderView::Interactive);
  6. header->setStretchLastSection(true);
  7. tableView->setModel(proxyModel);
To copy to clipboard, switch view to plain text mode 

There is no effect from any methods like QHeaderView::resizeSection() or ...setSectionHidden(). But ...setStretchLastSection() is work. I don't understand why!

Then headerData(), a part of EveModel:
Qt Code:
  1. QVariant EveModel::headerData(int section, Qt::Orientation orientation, int role /* =Qt::DisplayRole */ ) const {
  2.  
  3. if (orientation == Qt::Horizontal) {
  4. if (role == Qt::DisplayRole)
  5. return m_headers->count() > section ? m_headers->at(section) : QAbstractTableModel::headerData(section, orientation, role);
  6. if (role == Qt::SizeHintRole) {
  7. return QSize(1, 30);
  8. }
  9. }
  10. else if (orientation == Qt::Vertical) {
  11. if (role == Qt::DisplayRole)
  12. return QVariant();
  13. }
  14. return QAbstractTableModel::headerData(section, orientation, role);
  15. }
To copy to clipboard, switch view to plain text mode 

In the code above I added "return QSize(1,30);" string, but it actually has influence only at header's height , not width (regardless of params).

I think that I misunderstand the whole concept of such kind of operation in Qt. Would you please explain me?