[SOLVED]QML->C++ Pass associative array
-
Not sure if there is a direct conversion from associative arrays in JS to map in Qt. But you can do it by populating your array into a JS object and send it across.
@
var mymap = new Array;
mymap["one"] = 1;
mymap["two"] = 2;
var myObj = new myObject;
for (var key in mymap) {
myObj[key] = mymap[key];
}
cppEngine.setMap(myObj); // prototype is void setMap(QVariantMap map)
@