Qt5 qtablewidget size
-
wrote on 2 Aug 2019, 21:45 last edited by
Can a qtablewidget size with a window when the user resizes the window?
Every time I resize the window the table remains the same size, I would like the columns to expand, even if it is the last one.
I have this included already:
ui->tableWidget->horizontalHeader()->setStretchLastSection(true);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::Stretch);
ui->tableWidget->resizeColumnsToContents();
I had it in a horizontal layout, vertical layout, with spacer without spacer
I can set the minimum size, that works.
Thanks
-
Hi,
Are you sure that the layout is properly applied on the containing widget ?
Are you sure that you put your QTableWidget inside that layout ? -
wrote on 5 Aug 2019, 14:55 last edited by
No, that is what I am trying to figure out I must be doing something wrong if it does (suppose to, able to) size with the window.
I was not sure if it was possible to achieve what I want. -
No, that is what I am trying to figure out I must be doing something wrong if it does (suppose to, able to) size with the window.
I was not sure if it was possible to achieve what I want.wrote on 5 Aug 2019, 21:15 last edited by Pl45m4 8 May 2019, 21:22It seems, that your centralWidget has no layout.
In fact you created your tableView with Designer, check if there is a symbol with an X next to your centralWidget (on the right side of QtDesigner). It indicates that the specific container currently has no layout.
-
It seems, that your centralWidget has no layout.
In fact you created your tableView with Designer, check if there is a symbol with an X next to your centralWidget (on the right side of QtDesigner). It indicates that the specific container currently has no layout.
Hi
Just to be 100% clear. where @Pl45m4 wants you to check. -
Lifetime Qt Championwrote on 6 Aug 2019, 11:58 last edited by mrjj 8 Jun 2019, 11:59
@pl45m4
Yeah, but funny enough, i also thought of it as small red X :) -
wrote on 6 Aug 2019, 21:05 last edited by
I see the symbol , thanks.
Ah, I see what what I did, I was putting a layout in the form but not assigning a layout to the form.
Thanks!!!
I am just learning Qt.
Thanks for all the help and support and being so fast!
2/8