Plasma 2 DataEngine & QML bindings

Sebastian Kügler sebas at kde.org
Tue Jul 2 01:18:37 UTC 2013


Hi,

I'm looking into our dataengine and relevant QML bindings right now, I can now 
load a dataengine and use it from Plasma 2, but I have to convert the payload 
(::data() from a QHash to a QVariantMap.

In src/declarativeimports/core/datasource.*) the data property returns 
QHash<QString, QVariant>. This doesn't seem to be consumable from QML, 
(javascript code sees a  QVariant(QVariantHash), but I can't iterate over it, 
it has no keys, no [] accessors, etc..
Converting it to a QVariantMap instead makes it work from QML, but it's not 
actually what we want to do here. Or is it?

There's some qscriptvalue magic that I don't understand completely in 
dataenginebindings_p.h, is this the necessary glue to do the conversion 
automatically (and more efficiently)?

Cheers,
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list