开发者

ListModel , QMap, Xml parsing

开发者 https://www.devze.com 2023-02-25 03:23 出处:网络
i am trying to parse some car2go response xml and create my c++ model. then expose that model to qml.

i am trying to parse some car2go response xml and create my c++ model. then expose that model to qml.

Question: which map to use Qmap or qmultimap ? and how to parse ?

so looks 开发者_开发问答car2go response : http://code.google.com/p/car2go/wiki/vehicles_v2_0

THanks in advance


You can do it much easier than that. There are 2 ways:

1) Use XmlListModel and specify the xml option as a path

2) Since JSON is supported, use AJAX technique - use XmlHttpRequest in QML and post a request to the server and operate on your JSON object by getting it using JSON.parse(xml_http_request.responseText)

0

精彩评论

暂无评论...
验证码 换一张
取 消