KIconButton sizes

Lukas Appelhans l.appelhans at
Tue Feb 5 03:33:51 GMT 2008

Am Montag, 4. Februar 2008 07:02:59 schrieb David Faure:
> On Saturday 02 February 2008, Lukas Appelhans wrote:
> > Hi!
> > The attached Patch adds the functionality to KIconButton-class to only
> > set the Icon-Size for Dialog or Button.
> > For example: We in KGet need a Size of 16x16 for the Button, which looks
> > pretty bad in the Dialog...
> >
> > Any objections or comments?
> I don't understand, buttonIconSize/setButtonIconSize is already available
> as iconSize/setIconSize(QSize) (inherited from QPushButton), and
> setDialogIconSize is already available as setIconSize(int) (which also
> calls QPushButton::setIconSize(QSize)).
> Ah! So the real problem is that KIconButton's setIconSize method clashes
> with QPushButton's setIconSize since they have different meanings. Damn we
> should have renamed it for 4.0.
> So... you want a dialog that shows large icons, but a button that shows a
> 16x16 icon?
> In that case a solution is to call button->setIconSize(QSize(16,16))
> *after* calling button->setIconSize(int) if you call it at all.
> To make 
> this more obvious we could have a setButtonIconSize indeed, but: * in a way
> that makes it work also if setIconSize(int) is called afterwards * and I
> don't see a need for setDialogIconSize... we end up with too many redundant
> setters.
Ok a new patch is attached



-------------- next part --------------
A non-text attachment was scrubbed...
Name: kiconbutton.diff
Type: text/x-diff
Size: 1841 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list