Hi, I have added an icon to QPushButton, but the icon is always to the left side of text. Is there any way to set to icon on the top on the text??
Thanks in advance!!
Printable View
Hi, I have added an icon to QPushButton, but the icon is always to the left side of text. Is there any way to set to icon on the top on the text??
Thanks in advance!!
Hi,
You can look at image-position property in style sheets
Good Luck!
You can't as far as I know. If you use QToolButton, you can set toolButtonStyle to Qt::ToolButtonTextUnderIcon.
Hi,
Since icons are available for push buttons, there should be a way for locating it over the button.
It is strange that a QToolButton has that function while QPushButton doesn't.
Do you know the difference of them?
Thanks!!
Yeah, so do I think.
But I have read the doc, but find no such functions.
There is no such function for a QPushButton, because it is not the "aim" of regular button to have an icon above. If you want it above your text use QToolButton as mentioned.
So since QToolButton offers such a function there is absolutely no need that that is also provided by the QPushButton. Also since a QToolButton can behave exactly like a QPushButton...
Oh, thanks very much!!
But I have one more question: since QToolButtoncan do whatever QPushButtoncan, why Qt has QPushButton??
Because it's smaller and therefore has a better performance and it is sufficient for 99,9999% of the purposes/users.
Or do you use QGraphicsView every time you want to display a simple text or do you use simply a QLabel. So apparently you wont ask why is there a QLabel in Qt...