PDA

View Full Version : Scaling background image using styleSheet ? or any other way?



qtpyqt
26th May 2011, 10:45
I'm trying to resize a background image on a button


btn.setStyleSheet("background-image: url(:/AddButton.png);"
"background-repeat: no-repeat;")

tried it with


background-size: 10px auto;

but pyqt seems to be missing this CSS attribute

Is there any other way of scaling the background image on the button? I need the background image as the icon on the button will be used on top.

any suggestions?

wysota
27th May 2011, 21:27
Why don't you just use QAbstractButton::icon property?