PDA

View Full Version : Qt Stylesheet: border-image attribute ignored by QPushButton (works with QLineEdit)



bjoernbg
28th January 2007, 14:10
The subject pretty much says it all. I'm playing around with the Stylesheet-Example-Project with Qt 4.2 but wasn't able to set a border-image for the Buttons. The strange thing is that the lines

border-image: url(:/images/pushbutton.png) 4;
border-width: 4px;

work perfectly for QLineEdit but don't work for QPushButton at all!

Any help would be greatly appreciated!

I didn't change much in the example - just loaded the Form in Qt Designer, added the new image to the resource and recompiled everything - I'm using the stylesheet editor in the application itself to play around with it...

Thanks in advance!

wysota
28th January 2007, 14:51
I've seen border-image in action on QPushButtons, so you must have made some mistake. AFAIR the documentation has a working example of using border-images with a push button.

I just checked in Designer and it works fine for me. Check with an image taken from file, not from a resource.

bjoernbg
28th January 2007, 16:32
Thanks! Taking the image from file works!!

wysota
28th January 2007, 17:24
Looks like your resource was set up incorrectly and the image didn't exist. Did you link your application with that resource?