0

I have a problem with QToolButton and text alignement.

I want to align left the text, but not works.

I tryed, as reported in other forum :

    <i>QToolButton *button = new QToolButton;
    QString style = QString("QToolButton{text-align:left;}");
    button->setStyleSheet(style);</i>

or

    <i>QToolButton *button = new QToolButton;
    QString style = QString("text-align:left;");
    button->setStyleSheet(style);</i>

but always center aligned.

Can anyone help me?

Thanks!

Fabio
  • 1
  • 1

1 Answers1

0

http://doc.qt.io/qt-4.8/stylesheet-reference.html#text-align-prop

This property is currently supported only by QPushButton and QProgressBar.

Basicly You can't align text on QToolButton because it inherets QAbstractButton and not QPushButton.

Bogdan Kuštan
  • 5,427
  • 1
  • 21
  • 30