This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plasmoid in qml, run a function when config is updated

Tags: None
(comma "," separated)
vddon
Registered Member
Posts
1
Karma
0
Hi all,

I am developing a plasmoid(kde widget) and I need to run a function after you configure the plasmoid. So for example when you click on the "Apply" button in the plasmoid's configure menu the function should run. Is there some type of signal or something so I can achieve this?

Sorry if this question is already asked, but I do not know what to search for this question.
Already thanks for the effort
Poumpaloumpa
Registered Member
Posts
2
Karma
0
OS
You can use the Qml Connections object for that. Let's say you have a config key named "sample", you can listen for changes by using:
Code: Select all
Connections {
    target: plasmoid.configuration
    onSampleChanged: console.log("new value of sample: " + plasmoid.configuration.sample)
}


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]