Search code examples
pythonpyqt4qtstylesheetsqpushbutton

Color QPushButton plain white


I ould like to color a QPushButton in plain white, removing the 3D shade. The following stylesheet:

  'background-color: rgb(255,255,255); \
   border-color: rgb(92,92,92);color: \
   rgb(92,92,92); \
   font: bold 22pt "Avenir"')

gives me the following output:

enter image description here

and I would like to have the button color white uniformly instead.


Solution

  • The button property that I needed to set is:

    btn.setFlat(True)
    

    with this, the button is uniformly white colored.