PDA

View Full Version : adding image and text both to a push button



Charvi
31st July 2012, 13:57
Hi,

I want to add a small image centered on the push button as well as a descriptive text below it. This should give an effect like shown in the attached image.

8072

How can I achieve this.

Thanks in advance.
- Charvi.

high_flyer
31st July 2012, 14:26
How can I achieve this.
By calling the methods corresponding to adding an icon and a text to a button.

Charvi
31st July 2012, 14:33
By calling the methods corresponding to adding an icon and a text to a button.

Okay. Now how to set them one below the other ? Right they appear side by side.

yeye_olive
31st July 2012, 14:50
Use QToolButton instead of QPushButton.

Charvi
3rd August 2012, 08:52
Any other way of achieving this using push button itself ?

ChrisW67
3rd August 2012, 09:44
Sure, subclass QPushButton and override the paintEvent() to do whatever you want to paint the widget. You will almost certainly find the QToolButton easier to use.