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

Access DataSource data from QML plasmoid

Tags: None
(comma "," separated)
marioscalzo
Registered Member
Posts
1
Karma
0
Hi, I'm very new to plasma/qml. I'm trying to create a plasma DataEngine and a plasmoid that accesses to its data. The DataEngine is very simple: a source with a serie of QString as values. I tryed it in plasmaengineexplorer and it seems working fine. Then I passed to the plasmoid, very easy too: a simple Label to show one of the value stored in dataengine. I instantiated the dataSource this way:

Code: Select all
PlasmaCore.DataSource {
    id: dataSource
    engine: "myengine"
    interval: 30 * 60000;
    connectedSources: ["mySource"]
}


But I have a problem getting data from it. I'm using the following code:

Code: Select all
PlasmaComponents.Label {
    id: local;
    text: dataSource.data["mySource"]["myKey"];
}


But in console I have this error:

TypeError: Result of expression 'dataSource.data["mySource"]' [undefined] is not an object.


Can you explain my error?

Very thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If you don't get a response here, I suggest asking on #kde-devel or #plasma on Freenode, or on the plasma-devel@kde.org mailing list.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

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