how to change QCheckBox text label color in Qt?

后端 未结 4 774
别跟我提以往
别跟我提以往 2020-12-11 05:04

I\'m unable to change the color of Qcheckbox in QT, can somebody help me with code to change color of check box text label. I have tried

4条回答
  •  爱一瞬间的悲伤
    2020-12-11 05:46

    Looks like for some widgets you have to force using non-system "widget-engine". For checkbox it can be done by setting borders to none. So checkbox's style looks like:

    QCheckBox {
       border: none;
       color: white;
    }
    

    Similar behavior is required by other widgets. Some style-properties do not disable native look. For example QPushButton (http://doc.qt.io/qt-4.8/stylesheet-reference.html)

提交回复
热议问题