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

Qt-interest Archive, April 2007
Icon over text


Message 1 in thread

Hello trolls,

Is it possible to arrange Icon and under the Icon the text in QPushButton?

With the best regards,
Oleg Romanenko.

--
 [ signature omitted ] 

Message 2 in thread

QPushButton does not currently support this layout. You will have to 
subclass QPushButton and reimplement the painting code as well as the size 
hint yourself. However, depending on your needs you can try to use 
QToolButton for this purpose. It supports the layout that you require and it 
will look similar to a QPushButton when used in a form. Note that 
QToolButton does not support the default or autodefault properties.

Jens
-- 
 [ signature omitted ] 

Message 3 in thread

Jens Bache-Wiig wrote:
> QPushButton does not currently support this layout. You will have to 
> subclass QPushButton and reimplement the painting code as well as the 
> size hint yourself. However, depending on your needs you can try to use 
> QToolButton for this purpose. It supports the layout that you require 
> and it will look similar to a QPushButton when used in a form. Note that 
> QToolButton does not support the default or autodefault properties.
> 
> Jens

Thanks Jens! I believed the reimplementation is the only way. However, I 
will try the QToolButton.

Thanks a lot!

--
 [ signature omitted ]