I would like to be able to set the font size of the title of a QGroupBox using style sheets. I can't seem to figure it out.
Based on what I've read here, I've come up with the following code. Unfortunately, it doesn't quite work.
groupbox->setStyleSheet(style)
Where style
is:
QGroupBox::title
{
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 5 5px;
font-size: 18px;
font-weight: bold;
}
All of those style elements seem to be honored except font-size
and font-weight
. According to the Qt Style Sheets Reference, the font "property is supported by all widgets that respect the QWidget::font." Is this not the case for a QGroupBox's title?