QTabletWidget - Define a fix column width
Hello,
wondering if its possible ( basically i think so) to define a fix column width in my QTablewidget.
Example code:
Code:
// Table which displays informations about this computer
tableWidget->setRowCount(5);
tableWidget->setColumnCount(1);
tableWidget->setShowGrid(true); // show Grid
tableWidget->setWindowModality(Qt::ApplicationModal); //tableWidget->setSizePolicy(Expanding, Expanding, 0,0);
tableWidget->setSortingEnabled(false);
tableWidget->setCornerButtonEnabled(true);
I would like to be able to define the width of both columns i am using right now.
Would be great if you could help me locating the correct keyword for the Qt docs.
My search for size, width etc was not successfull unfortunaly
Best regards
ape
Re: QTabletWidget - Define a fix column width
its not the best solution, but enough for my case:
Code:
tabletWidget->horizontalHeader()->setStretchLastSection(true);
Re: QTabletWidget - Define a fix column width
I did it like this
Code:
tableWidget
->horizontalHeader
()->setResizeMode
(8,
QHeaderView::Fixed);