Hi, I am having a strange bahavour and I'd like to ask you if somebody understand why.
I have a QTableWidget called m_tbl.
ui.m_tbl->setColumnCount(3);
ui.m_tbl->horizontalHeader()->setStretchLastSection(true);
ui.
m_tbl->horizontalHeader
()->setResizeMode
(1,
QHeaderView::ResizeToContents);
ui.
m_tbl->horizontalHeader
()->setResizeMode
(0,
QHeaderView::Fixed);
ui.m_tbl->horizontalHeader()->setDefaultSectionSize(25);
ui.m_tbl->setColumnCount(3);
ui.m_tbl->horizontalHeader()->setStretchLastSection(true);
ui.m_tbl->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
ui.m_tbl->horizontalHeader()->setResizeMode(0, QHeaderView::Fixed);
ui.m_tbl->horizontalHeader()->setDefaultSectionSize(25);
To copy to clipboard, switch view to plain text mode
From the docs, setDefaultSectionSize says: "This property holds the default size of the header sections before resizing.
This property only affects sections that have Interactive or Fixed as their resize mode."
As far as a I understand, this means my first column should have width 25, the second resize to its contents and the third fill the hole table.
BUT what I get are two columns with 25 od width and the last one doing setStretchLastSection() normally.
thanks!
Bookmarks