QTableWidget and setting height
-
@Kris-Revi
If you are asking how to make that horizontal header higher, purely at a guess (don't know if there is anything better) what doesui->tableWidget->horizontalHeader()->setMinimumHeight(int minh);
do?
-
@Kris-Revi
Don't know exactly what you want, but are you aware you can access the header via QHeaderView *QTableView::verticalHeader() const, does that let you do what you want? -
@Kris-Revi
Don't know exactly what you want, but are you aware you can access the header via QHeaderView *QTableView::verticalHeader() const, does that let you do what you want?@JonB let me try and explain!
With a QTableWidget you can do
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Custom); ui->tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Custom); ui->tableWidget->setColumnWidth(0, 48); ui->tableWidget->setColumnWidth(4, 45);
to make the Header stretch horizontaly and also set Width on each column! but is there a way to set Height?
-
@JonB let me try and explain!
With a QTableWidget you can do
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Custom); ui->tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Custom); ui->tableWidget->setColumnWidth(0, 48); ui->tableWidget->setColumnWidth(4, 45);
to make the Header stretch horizontaly and also set Width on each column! but is there a way to set Height?
@Kris-Revi
In above code you can also useverticalHeader()
forhorizontalHeader()
andsetRowHeight()
forsetColumnWidth()
, so what else are you looking for? -
@Kris-Revi
In above code you can also useverticalHeader()
forhorizontalHeader()
andsetRowHeight()
forsetColumnWidth()
, so what else are you looking for? -
@Kris-Revi
If you are asking how to make that horizontal header higher, purely at a guess (don't know if there is anything better) what doesui->tableWidget->horizontalHeader()->setMinimumHeight(int minh);
do?
-
@Kris-Revi
If you are asking how to make that horizontal header higher, purely at a guess (don't know if there is anything better) what doesui->tableWidget->horizontalHeader()->setMinimumHeight(int minh);
do?
-