← Back to team overview

ubuntu-phone team mailing list archive

Re: Multiple nested levels in a QML XmlListModel

 

Hi Simon,

Check out the "xml" property of the XmlListModel. [1]

Try something like the following:

XmlListModel {
   id: modelOne
   ...
}

XmlListModel {
   id: modelTwo
   xml: modelOne.xml
}

That will make the second model use the content the first model downloaded. ;)

Cheers,
Niklas

[1] http://doc.qt.io/qt-5/qml-qtquick-xmllistmodel-xmllistmodel.html#xml-prop

Am Mi, 15. Apr, 2015 um 9:06 schrieb Simon <hamfilter@xxxxxxxxx>:
Hi everyone,

I am learning QML and have a question but ask.ubuntu.com and
stackoverflow are not as responsive to QML questions as I hoped, is this
the right place to ask for help?

I am wondering how to query a second level in an XML file. Currently
using an XmlModelList with a ListView but it **downloads the same file
multiple times** which is clearly not the best solution on a phone with
a spotty connection.

https://stackoverflow.com/questions/29189248/multiple-nested-levels-in-a-qml-xmllistmodel

Thank you!

-- Simon


--
Mailing list: https://launchpad.net/~ubuntu-phone
Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ubuntu-phone
More help   : https://help.launchpad.net/ListHelp

Follow ups

References