Plasma Components Question

Lasath Fernando kde at lasath.org
Fri Jan 13 12:22:31 UTC 2012


That's not quite what I'm after. I need to be able to set the icon of
the button itself. For example, the JavaScript API's PushButton had a
property called icon of type QIcon.

I was hoping there's a would be a way to do the same using the proper
Components.

On Thu, Jan 12, 2012 at 8:59 PM, Sebastian Kügler <sebas at kde.org> wrote:
> Hi Fernando,
>
> On Thursday, January 12, 2012 06:36:29 Lasath Fernando wrote:
>> I've been using Plasma Components 4.8 for a new plasmoid in
>> telepathy-kde, and I have a question regarding the Button (or
>> ToolButton) component.
>> From what I've seen so far, it only has a property to set the source
>> for the icon.
>> I need a way to set the icon directly as a (Q|K)Icon, as the only way
>> to get the icon for a user's current presence is through the
>> KTp::Presence::icon() method, which returns a KIcon.
>> So far, I've been using a workaround to get icon sources that causes a
>> lot of ugly and duplicate code in our libraries, and have been told to
>> find a way to avoid.
>>
>> So, is there something I'm missing?
>
> We've put a few of those why-the-hack-didn't-qdeclarative-bind-those types
> into qtextracomponents, which is in kde-runtime.
>
> Try
>
> import org.kde.qtextracomponents 0.1
>
> QIconItem {
>        icon: QIcon("edit-paste")
> }
>
> Cheers,
> --
> sebas
>
> http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list