PDA

View Full Version : Making a QPushButton style-pressed not only when clicked !!!



gab74
12th September 2011, 15:00
Good morning i'm new in Qt programming and for my project i have to use old QT 4.2.3

Problem is that.
When i click on QPushButton i changed the text color and background, and i want the button remains with this style untill i press the button again..

i try to make some examples :
first simple case : a button that when clicked remains whith a new stylesheet:


Using stylesheet (QPushButton:pressed) the button remain in the new style only when pressed, but after pressed it returns in its initial state...

How can set the style for a button when clicked, that remains also after clicked ??

Thanks Gabriele

.

wysota
12th September 2011, 15:06
Set the button's "checkable" property to true.

gab74
12th September 2011, 15:40
Thanks for the quick answer !!!

I will "transform" the button from Designer and enable checkable !!!