How set height of all rows(QTableView)
-
wrote on 21 Nov 2018, 18:17 last edited by Engelard
Hi.I was searching google for function of QTableView and QStandardItemModel, but can't find one. Seems like exist func only for single setRowHeight, no for all rows in model.
-
Hi.I was searching google for function of QTableView and QStandardItemModel, but can't find one. Seems like exist func only for single setRowHeight, no for all rows in model.
-
wrote on 21 Nov 2018, 19:11 last edited by
For the vertical header, call setDefaultSectionSize()
QHeaderView* header=tableView->verticalHeader(); header->setDefaultSectionSize(20); // 20 px height header->sectionResizeMode(QHeaderView::Fixed);
-
@Engelard
What do you mean?setRowHeight()
is the row height for each row to be displayed. How could you have a height for all rows when there could be any number of them, and what would you use it for anyway?wrote on 21 Nov 2018, 20:58 last edited by@JonB said in How set height of all rows(QTableView):
setRowHeight() is the row height for each row to be displayed.
No, it's only for particular, not for each.
@mpergand said in How set height of all rows(QTableView):
header->setDefaultSectionSize(20); // 20 px height
This.
-
1/4