Solved QTableWidget: Prevent users from changing the row height
-
I want to stop the users from being able to change height of rows in qtablewidget.
I thought this was a trivial task(a function call away) but I can't seem to find a way to do that.
In the pic above you can see that user increased the height of the row 2. How can I stop that from happening?Thanks in advance.
-
You're looking for QHeaderView::setSectionResizeMode()
-
-
@hbatalha
Yes, it is not a member of aQTableWidget
/QTableView
. @Christian-Ehrlicher shows you it's a member ofQHeaderView
. SeeQTableView::horizontalHeader
/verticalHeader()
. -
@JonB oh ok, now I got it. It works, thank you guys.
table->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);