Reply to topic

Plasmoid in qml, run a function when config is updated

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)
}

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], blue-on, blue_bullet, claydoh, colstar, funkyskywalker, Google [Bot], jmacleod, koffeinfriedhof, kyrawertho, lcornell, Lenny McLennington, magkoc, ostroffjh, paule, quisimodo, Sogou [Bot], ssl, steveblezy