Reputation: 8211
When I create a QPushButton with an Icon it by default displays the text to the right of the icon. Is there a way to have the text display above the icon?
Upvotes: 0
Views: 1447
Reputation: 3187
The easiest way is to use a QToolButton
instead. This class has a method named setToolButtonStyle
, which allows you to do exactly what you want.
In C++ (I have never messed with PyQt):
QToolButton *button = new QToolButton(this);
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
Link to the C++ docs: QToolButton and Qt::ToolButtonStyle
Upvotes: 2