Set QGroupBox title font size with style sheets

前端 未结 1 1075
暗喜
暗喜 2021-02-18 23:00

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 u

1条回答
  •  甜味超标
    2021-02-19 00:03

    The answer is "no", the title of a QGroupBox does not support the QWidget::font property. I suspect that the title is not an independant QWidget but a part of the QGroupBox widget (thus drawn by the QGroupBox::paint()).

    However, the GroupBox widget supports the font property and since the only text displayed by a group box is its title, you can apply your font style to the QGroupBox widget.

    QGroupBox
    {
        font-size: 18px;
        font-weight: bold;
    }
    

    0 讨论(0)
提交回复
热议问题