tags:

views:

230

answers:

1

Is it possible to set and change the icon on a QPushButton using stylesheets?

I need this for a Windows-based white-label Qt4.5 application that customers stylize using stylesheets.

Thanks.

+1  A: 

Yup.

border-image: url(/url/to/image);
Brian Roach
Thanks for replying. This appears to set the background of my QPushButton to the image rather than the QPushButton's icon. Any ideas what I've done wrong? Thanks.
Robin
Huh, I thought that set the icon, with `background-image:` setting the background. I'd have to play with it, apparently my memory is not what it used to be.
Brian Roach
It looks like you have to style the icon size, the alignment, and the text alignment so everything lays out correctly. I don't have time to mess with it right now, but everything I read via a couple google searches says that `border-image:` is the icon in regard to the stylesheet.
Brian Roach