Setting text alignment of a QToolButton
-
wrote on 19 Apr 2012, 11:57 last edited by
Hello Qt devs!
I cannot figure out how to left align my text on a QToolButton.
Can you help me out?
Thank you for your time!
-
wrote on 19 Apr 2012, 12:28 last edited by
Hi,
I also tried the same with stylesheets by setting the "text-align: left;" property but it didnt work out.
One interesting thing is that if we add an image to the toolButton then the text is aligned to the left.
So for the time being you can add a tranparent image to your resources/toolButton and write@ui->toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);@
-
wrote on 19 Apr 2012, 12:44 last edited by
Well the thing is that I already have added a icon to the QToolButton, and the text is still centred.
Also, my text is set to be under:
@toolButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);@
I guess I have to have short button texts then...Thank you for your time!
1/3