[Qt-interest] How to set all button's background except one whose x()=100?

Lars Amsel lars.amsel at signalion.com
Wed Jul 8 08:28:47 CEST 2009


Kermit,

Kermit Mei wrote:
> Hello,community!
> I want to set all the buttons on a widget, but except the one whose x()
> is always 100. How to write the .css syntax?
> 
> For example,
> QPushButton[x=100] {border-image: url(:/images/key.png); }
> but, now the x!=100.

This selectors only works for Qt Properties. The Property is not x but 
geometry. So this probably wont work. I just don't know whether this works at 
all for properties like geometry in any way.
But you could set a custom property. See: 
http://doc.qtsoftware.com/4.5/stylesheet-examples.html#customizing-using-dynamic-properties

regards

Lars




More information about the Qt-interest-old mailing list