PDA

View Full Version : QAbstractButton::setIcon | Icon posiition



ouekah
10th May 2010, 19:02
Hi,

is there a way to place an icon in the right side of the text within a button ? If so how ?

QAbstractButton::setIcon places an icon in the left side of the text and so far I haven't found any flag or setting to change that

SixDegrees
10th May 2010, 22:10
You might try button->setLayoutDirection(Qt::RightToLeft). This is meant to change the layout direction when different languages are used, so employing it this way seems like a bit of a misuse, if it works at all.

SixDegrees
10th May 2010, 23:56
It may also be possible - and more sane - to do this using style sheets. I'm not certain what the specific incantation would be, but this seems like a better bet than fiddling around with layout direction, which can be overridden by the UI style anyway.