Qt Qcheckbox - how to style the tick sign

326 Views Asked by At

My setup is Raspberry Pi, Python 3.9.2, Pyside2, Qt Designer. The original (without style) QcheckBox size is too small for my design, So I increased its size with width= and height= (seen here Increase check box size not its text using QCheckbox? ) on Qt Designer.

The problem is that the tick sign remained the same (small), now shown in a corner of the big QcheckBox. So, two questions:

  • How to increase the size of the tick sign?
  • How to change the color of the tick sign (and not the text)?

I made what is suggested here Increase check box size not its text using QCheckbox? and here https://www.geeksforgeeks.org/pyqt5-changing-size-of-indicator-in-check-box/ but none of them talks about the tick size.

1

There are 1 best solutions below

1
Pamputt On

What about using

checkbox.setStyleSheet("QCheckBox::indicator {"
    "width: 20px;"
    "height: 20px;"
    "color: blue;"
"}");