how to change QCheckBox text label color in Qt?

后端 未结 4 771
别跟我提以往
别跟我提以往 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 06:01

    This works for me:

    QPalette p = myCheckBox->palette();
    p.setColor(QPalette::Active, QPalette::WindowText, green);
    myCheckBox->setPalette(p);
    

提交回复
热议问题