QML global plasmoid callback problem

Marco Martin notmart at gmail.com
Sun Feb 5 14:58:31 UTC 2012


On Sun, Feb 5, 2012 at 3:39 PM, uomonero <uomonero84 at gmail.com> wrote:
> Hi,
> I'm new to plasmoid development. I'm trying to learn how to write a
> QML plasmoid, but I encountered a little difficulty with the use of
> global plasmoid object.
>
> This is my simple test code:
>
> import QtQuick 1.0
> import org.kde.plasma.core 0.1 as PlasmaCore
> import org.kde.plasma.components 0.1 as PlasmaComponents
>
> PlasmaComponents.Label{
>        id: labelTest
>        text:"Test"
>
>        Component.onCompleted:{
>                plasmoid.addEventListener("sizeChanged", sizeChanged);
>        }
>        function sizeChanged(){
>                print("sizeChanged listener");
>        }
> }
>
> Running with plasmoidviewer, when I resize the plasmoid nothing is printed.
> What's wrong?


uhm, apart that sizeChanged in particular isn't really necessary since
the size is the size of the root item, if that label is the plasmoid
main script it should work fine

Cheers,
Marco Martin


More information about the Plasma-devel mailing list