Bug 201793

Summary: KPushButton icon property cannot be set in Qt Designer
Product: [Frameworks and Libraries] kdelibs Reporter: George Goldberg <grundleborg>
Component: kdeuiAssignee: Michael Leupold <lemma>
Status: RESOLVED UPSTREAM    
Severity: normal CC: cfeck, lemma
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:

Description George Goldberg 2009-07-28 18:03:44 UTC
Since we are encouraged to use Qt Designer and .ui files for as much UI stuff as possible when developing KDE applications, it would be helpful if KPushButton would allow its icon (using a freedesktop.org icon naming spec string) to be set in Qt Designer.
Comment 1 Michael Leupold 2009-07-28 18:13:26 UTC
Agreed :) I'll look into it.
Comment 2 Michael Leupold 2009-07-30 15:47:37 UTC
Quick update:
It would be possible to add an extra iconName property. Unfortunately that is pretty un-generic and all other widgets using KIcons would need a similar property as well (apart form that it already works well here :-)). I'm currently trying to figure out if Qt will provide an interface to add new property types for editing in designer.
Comment 3 George Goldberg 2009-07-30 16:08:58 UTC
I'm not sure if it's relevant, but I am able to set the icon on a KIconButton in designer (perhaps this could give a clue how to do it, or does it just use the extra iconName property?).
Comment 4 Michael Leupold 2009-07-30 16:22:06 UTC
Unfortunately it's the latter. KIconButton has a QString icon property which will set and load the icon on changing.

There's actually another drawback to the QString property: It seems the property is changed on every textChanged() signal, so whenever you type a key into the property editor the string gets updated and it will try to reload the icon (which sometimes adds a sloppy feel to it). Admittedly still better than the status quo.
Comment 5 Christoph Feck 2010-01-31 23:35:04 UTC
With the recent addition of QIcon::fromTheme() we may have luck that Qt Designer natively supports this.

http://bugreports.qt.nokia.com/browse/QTBUG-7777

I am closing this as upstream, as it does not make sense to have it only supported in KPushButton.