When I use a style sheet to define a font-size larger than the default for a QTableWidget's horizontal header, the text gets cropped. This happens regardless of whether I elideLeft, elideMiddle, or elideRight.
QString header_styleSheet
= "::section {" // "QHeaderView::section {" "spacing: 1px;"
"background-color: orange;"
"color: purple;"
"border: 1px solid purple;"
"margin: 1px;"
"font-family: arial;"
"font-size: 18px; }";
splitTimes->horizontalHeader()->setStyleSheet(header_styleSheet);
QString header_styleSheet = "::section {" // "QHeaderView::section {"
"spacing: 1px;"
"background-color: orange;"
"color: purple;"
"border: 1px solid purple;"
"margin: 1px;"
"font-family: arial;"
"font-size: 18px; }";
splitTimes->horizontalHeader()->setStyleSheet(header_styleSheet);
To copy to clipboard, switch view to plain text mode
Here's what the header looks like with 18 px font:
header_clipped.png
versus a 12 px font:
header_ok.png
It's like the eliding code isn't aware of the font-size that was applied with the stylesheet.
I saw the same type of thing for horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
Is there something I need to do to change the horizontal header font size other that using a style sheet to avoid this?
Thanks,
Dave Thomas
Bookmarks