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.



Qt Code:
  1. QString header_styleSheet = "::section {" // "QHeaderView::section {"
  2. "spacing: 1px;"
  3. "background-color: orange;"
  4. "color: purple;"
  5. "border: 1px solid purple;"
  6. "margin: 1px;"
  7. "font-family: arial;"
  8. "font-size: 18px; }";
  9.  
  10. 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