My question is related to the thread http://www.qtcentre.org/forum/f-qt-p...ues-14764.html that discusses disabling scroll bars in the QTableView. When a user resizes a column or a row I'd like the scroll bars also to not appear. It seems that all I need to do is to invalidate the layout of my table view. I modified the code shown in the post above by adding a slot that calls setFixedSize() on a sub-class of QTableView and connecting sectionResized signals from vertical and horizontal headers to my new slot:

Qt Code:
  1. MyTableView::MyTableView(QWidget* parent)
  2. : QTableView(parent)
  3. {
  4. QObject::connect(verticalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(headerResized(int, int, int)));
  5. QObject::connect(horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(headerResized(int, int, int)));
  6. }
  7.  
  8. void MyTableView::headerResized(int, int, int)
  9. {
  10. setFixedSize(minimumSizeHint());
  11. }
To copy to clipboard, switch view to plain text mode 

This code invalidates the layout but the documentation of setFixedSize says that

This will override the default size constraints set by QLayout.
Would it be possible in Qt to invalidate the layout without overriding the default size constraints?

Thanks in advance,
Yuri