You'll get the same results by setting the model after the setResizeMode() statements in DummyDialog. Try this:
. . .
myTable->horizontalHeader
()->setResizeMode
( 5,
QHeaderView::Fixed );
TestCheckModel *aModel = new TestCheckModel( this );
myTable->setModel( aModel );
qDebug() << "**************** After setResizeMode call **************************";
. . .
. . .
myTable->horizontalHeader()->setResizeMode( 5, QHeaderView::Fixed );
TestCheckModel *aModel = new TestCheckModel( this );
myTable->setModel( aModel );
qDebug() << "**************** After setResizeMode call **************************";
. . .
To copy to clipboard, switch view to plain text mode
As you'll see, when you set the model it resets a column's resize mode to "0". Also evidenced by the columns being adjustable.
I put in a setStretchLastSection(true) statement and it worked no matter when the model was set. I'm not sure of the reasoning behind having stretchLastSection() survive the setting of a new model and resizeMode() not. Looks like either all settings would translate to the new model or none would.
Take a look at the sources, there might be a clue there. I will if I get a minute. Or maybe one of the gurus around here will clue us in.
Bookmarks