How do I create an Option button like VB?Pressed then down, pressed again then up.
At Visual Basic 6 I can create several option buttons, if one pressed, it is in down state, press it again, it pops up.
Is there a way in QT can do this?
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
A QToolButton will do what you want I guess.
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
Hi,
Set the 'checkable' property. Even normal buttons (like a QPushButton) can have this property set.
Regards,
Marc
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
Quote:
Originally Posted by
marcvanriet
Set the 'checkable' property.
Quick note to the OP, you can use either
Code:
setProperty
("checkable",
QVariant(true));
or
Code:
setCheckable(true);
to do this. I guess some properties are so frequently useful that convenience functions have been added. :)
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
the checkable property is definitely right
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
One more question, is it possible to have text automatic wrapped to next line if button is narrowed.
Re: How do I create an Option button like VB?Pressed then down, pressed again then up
Found how to do it, add "\n" in between text.