Search code examples
qtqradiobutton

QRadioButton style


Is it possible to make a QRadioButton which looks like a button,and changes it's background when checked? Which property of the class i should refer to?

How to create a menu similar to this one:

menu

Any examples? I'm using QT 4.8


Solution

  • QRadioButton is a QAbstractButton. you can use stylesheet to style it. you can use any of these pseudo states :checked :disabled :enabled :focus :hover :indeterminate :pressed :unchecked

    You can also make your own style by inheriting QStyle and latter feed that style to your application.

    You can inherit QAbstractButton and check QAbstractButton::setCheckable

    Check Out this QML Example