Hi everyone,

How can I get a list of the keys in a QML map?

Defining a map like this works:
property variant theMap: { "key1":"value1", "key2":"value2", "key3":"value3" }

Now I want to know all the keys used in the map, i.e. something like this
function keys() {
    var theKeys = theMap.keys();
    return theKeys;
}

that I would expect to return an array like this:
["key1", "key2", "key3"]
but it seems the map object doesn't have a keys() function, or anything else 
similar I've tried. 
Is that so, or have I just not found the right syntax?

The map type is missing from the documentation of basic QML types:
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativebasictypes.html
(see http://bugreports.qt.nokia.com/browse/QTBUG-16196)


Cheers
Mathias
 
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to