PDA

View Full Version : Tool button problem



sudhansu
12th February 2010, 05:51
Hi All,
I've a tool button, it is implimented in a class. and i'm creating the object of tool button in mainwindow class. And the back ground color of tool button is of rgb 128,128,128. I need to fade the color if it is disabled. I did like below.


button->disableToolButton(true);
button->setStylesheey("background color : QColor(140,140,140)");:(

But its not working. Any suggestion, how to achieve it??

N.B : I'm overriding the paintevent of QtoolButton, in my toolbutton class.

franz
12th February 2010, 06:18
Does it work with the standard QToolButton class?

aamer4yu
12th February 2010, 06:34
Are you using same spelling ( stylesheey) in code ?
Try this -

button->setStyleSheet("background color : rgb140,140,140)");

Style sheets doesnt know about QColor !! ;)

sudhansu
12th February 2010, 08:18
Are you using same spelling ( stylesheey) in code ?
Try this -


Style sheets doesnt know about QColor !! ;)
no , i'm using stylesheet .

Lykurg
12th February 2010, 08:59
Your syntax is corrupt:
background-color: #8C8C8C;

aamer4yu
12th February 2010, 09:23
no , i'm using stylesheet .
I didnt just point about the spelling mistake,,, it was also you are using QColor in stylesheet,,, while you should use rgb instead !

sudhansu
12th February 2010, 09:51
I didnt just point about the spelling mistake,,, it was also you are using QColor in stylesheet,,, while you should use rgb instead !

Actually my requirement is, to disable the toolbutton, text and image placed on top of the button. so that it's color will be fade.
How to do it.