0

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

Community
  • 1
  • 1
Evgenii.Balai
  • 939
  • 13
  • 30

1 Answers1

1

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

Neel Basu
  • 12,638
  • 12
  • 82
  • 146
  • Thanks! The stylesheets are probably what i need. I will read about them – Evgenii.Balai Mar 26 '12 at 19:09
  • One more newbie question: Suppose i want to draw a picture on the button. How can i make the picture a part of the project?Is there any possibility to create some inner project resource so it will be included to binary automatically and i will not need to deliver it separately from the executable file? – Evgenii.Balai Mar 26 '12 at 19:09
  • You don't need to draw. You can `setIcon()` for a Button. that icon will be part of the resource (qrc). and the resource will be part of your executable – Neel Basu Mar 26 '12 at 19:11
  • Great, thank you for the help.. Icons are probably what i need. Sorry for the stupid questions,and i'm very noob in designing GUIs and it takes so much time to find necessary things in the documentation... – Evgenii.Balai Mar 26 '12 at 19:14