Set minimum column width to QTableView.
-
wrote on 29 Mar 2016, 13:59 last edited by
Hello
I have QTableView with model and delegate. I have several columns. So I can resize them by mouse, But now I need to set a minimum width for the first column. So this column's width shouldn't be less then some number(100) for example. How is this possible?
thanks. -
-
wrote on 29 Mar 2016, 14:58 last edited by
@mrjj
thanks for answer, but it's not what I want, As I guess it sets default width to the column, which can be resized but I need the minimum width So that column couldn't be resized to be smaller than this value. I need something like setMinimumColumnWidth(int column, int value) or something like that. -
@mrjj
thanks for answer, but it's not what I want, As I guess it sets default width to the column, which can be resized but I need the minimum width So that column couldn't be resized to be smaller than this value. I need something like setMinimumColumnWidth(int column, int value) or something like that.@tokafr said:
hmm i know no such method. sorry.
and
resizeColumnsToContents()
is still not good enough as you want to limit resize.Give it some time, good change some of the others will know a way.
-
Hi,
You can try with the QHeaderView::minimumSectionSize property
4/5