Button with text below.

I am very new to developing QT UI.

I need to create a button with text under the icon. Unable to set this property in QPushButton.

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

How can I display an icon with text under the icon in Qt? Any suggestions ?.

+3
source share
1 answer

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

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

QPushButton, , . , , , , paintEvent() update() setStyleSheet(). ( , )

"" Qt...

.

0

Source: https://habr.com/ru/post/1745776/


All Articles