1

ALL,

The QPushButton class has a member setIcon() which set the icon to be displayed on the button.

However, there is no parameter to set the icon alignment.

Is there a way to set the icon alignment for the QPushButton?

Thank you.

Igor
  • 5,620
  • 11
  • 51
  • 103
  • second result from google: https://stackoverflow.com/questions/44091339/qpushbutton-icon-aligned-left-with-text-centered/44274465 – Phiber Oct 19 '18 at 19:12
  • @Phiber, I actually want an arbitrary alignment based on the flag: `left`, `top`, `right` or `bottom`. I guess one can just do painting based on the flag inside the paintEvent(), right? – Igor Oct 19 '18 at 19:40
  • I think you should to look at `drawControl()` by overriding `ProxyStyle`, there, you can find `Qt::Alignement` – Phiber Oct 22 '18 at 12:21

0 Answers0