Opinion on config dialog for QML plasmoids

Viranch Mehta viranch.mehta at gmail.com
Thu Aug 18 11:43:23 UTC 2011


On Thu, Aug 18, 2011 at 2:09 AM, Marco Martin <notmart at gmail.com> wrote:

>
> i tought i explained it: a QMap<QString, QString> will never work.
> you need to change it to QMap<QString, QVariant>, as easy as that
>
>
That doesn't work either (I had tried it when it was made QVariantMap in the
engine). It works if I access in the following manner:

Text {
    text: dataSource.data["PowerDevil"]["Available profiles"]["Performance"]
}

But not in the case:

Component.onCompleted: {
    var profiles = dataSource.data["PowerDevil"]["Available profiles"];
    // do stuff with the map, eg iterate
}

The latter simply stops at the first line inside the onCompleted saying,
dataSource.data["PowerDevil"] [undefined] is not an object, and just
wouldn't go any further. The former cannot be used because we wouldn't know
names of all the profiles beforehand. Hence we need to iterate over the keys
and get the values from the map, which, as I said, is not working even with
QVariantMap.

Viranch


>
> --
> Marco Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20110818/0633ae7f/attachment.html>


More information about the Plasma-devel mailing list