Qt 6.11 is out! See what's new in the release
blog
How to set the width of a column on QTableWidget
General and Desktop
4
Posts
2
Posters
11.2k
Views
1
Watching
-
Hi guys,
I'd like to set a specific width for a column of the QTableWidget I'm using on my GUI. How can I do that?
-
I solved my trouble with this code:
@
//configure the rows and the columns on the table
ui->stepsViewer->setColumnCount(5);
ui->stepsViewer->setColumnWidth(0, 80);
ui->stepsViewer->setColumnWidth(1, 80);
ui->stepsViewer->setColumnWidth(2, 150);
ui->stepsViewer->setColumnWidth(3, 150);
//ui->stepsViewer->setColumnWidth(4, 250);
ui->stepsViewer->horizontalHeader()->setStretchLastSection(true);
@ -
thanks for your interest in this matter @qxoz.