Unsolved Can QHeaderView (horizontal) resize its height to its header label text?
-
I'm using a slightly larger than default font size for my table headers
my_table->horizontalHeader()->setStyleSheet( QString( "QHeaderView { font-size: 12px; }" )
which results in some letters being cropped at the bottom (g, j,...).
I don't want to set a fixed height for the header, since it introduces issues on high-DPI screens. Is there a way to have the QHeaderView adapt its height to the text, like a QPushButton does?
If the answer is "custom paint()", I'll rather remove all the g's and j's from my header texts, haha... ;( -
There is a bug for this already: https://bugreports.qt.io/browse/QTBUG-56457
-
Ok, the bug seems to be not exactly your problem but maybe related. Can you please provide a complete minimal testcase to reproduce the issue? What OS and Qt version do you use?