tags:

views:

47

answers:

1

Hi, I am very new to QT UI development.

I need to create a button with text should be below the icon. There is no option to set this property to the QPushButton.

When I tried to search in the net, they told me to use QToolButton. When I used the QToolButton I could set the Qt::ToolButtonTextUnderIcon. But I couldn’t find a way to change the dimension i.e. Width, height, x and y position.

Please help me to display a icon with text should be bellow the icon.

A: 

Hi.

For QToolButton: all that you need (i.e. width, height, x, y) QToolButton has! Take a look here and here some methods:

setFixedHeight ( int )
setFixedSize ( const QSize & )
setFixedSize ( int, int )
setFixedWidth ( int )

What about QPushButton, probably it does not support changing placement of icon and text. But maybe some how it's possible, for example reimplementing paintEvent() methods or doing update() with setStyleSheet() methods. (But this is not the noob way, sorry)

By the way here is some interesting "changed" Qt widgets...

Good luck.

mosg