Accessing a C++ dataengine from a QML plasmoid

Guillaume DE BURE guillaume.debure at gmail.com
Wed Jan 30 21:10:40 UTC 2013


Hi all,

Reading the documentation on userbase did not really help me on understanding what is going wrong on what I'm trying to achieve, maybe one of you will be able to help.

Some context:
For years, I've been trying to use plasma inside Skrooge to manage our dashboard. Long story short, I've somehow managed to get something ruunning in C++, but would like to move to QML, as this is clearly the way to go.

The problem:
I have a dataengine running inside Skrooge, that fetches data from the .skg file (which is in fact, an SQLite file). This dataengine is written in C++, and the relevant code can be found there:
https://projects.kde.org/projects/extragear/office/skrooge/repository/revisions/plasma-dashboard/entry/skg_dataengine/skgdataengine.cpp#L97

As you can see this dataengine contains a source "Accounts", for which keys are an account name, and values are a QHash containing other account properties.
Accessing this data from a C++ plasmoid works well (code: https://projects.kde.org/projects/extragear/office/skrooge/repository/revisions/plasma-dashboard/entry/plugins/applet/account/accountskroogoid.cpp)

However, I am not completely clear how to access it in QML. Userbase seems to say it should be possible:
http://techbase.kde.org/Development/Tutorials/Plasma/QML/API#DataModel

So I made an attempt that looks like this, but that does not work:
https://projects.kde.org/projects/extragear/office/skrooge/repository/revisions/plasma-dashboard/entry/plugins/applet/account-qml/contents/ui/main.qml

Can anybody help me ? Thanks in advance :)

Guillaume


-- 
Skrooge, a free, Open Source, personal finances software for linux, Mac OS, Windows
http://skrooge.org


More information about the Plasma-devel mailing list