Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, December 2007
QPushButton : icon on the right of text?


Message 1 in thread

Hello,

maybe I haven't searched enough in the doc but i wonder how to position the
icon on the right of the label in a QPushbutton?
should i re-implement the painter of the qpushbutton or is there an easier
way to do that?

(I checked the Qt::ToolButtonStyle with the QToolButton but the only
possibilities are ToolButtonTextBesideIcon or ToolButtonTextUnderIcon)

Yannick

Message 2 in thread

On onsdag den 19. December 2007, Yannick Barbeaux wrote:
> Hello,
>
> maybe I haven't searched enough in the doc but i wonder how to position the
> icon on the right of the label in a QPushbutton?
> should i re-implement the painter of the qpushbutton or is there an easier
> way to do that?
>
> (I checked the Qt::ToolButtonStyle with the QToolButton but the only
> possibilities are ToolButtonTextBesideIcon or ToolButtonTextUnderIcon)

This is a case of "should I really do this??" There is a reason this isn't 
supported by Qt. Doing something non-standard can sometimes make you stand 
out from the rest, sometimes simply confuse. This particular one seems silly 
and confusing.

If you really want to, maybe you can cheat it by making the button think it 
should work in an RTL layout?

Bo.

-- 
 [ signature omitted ]