ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #12218
Re: Multiple nested levels in a QML XmlListModel
Thank you Niklas. I am playing with your solution but can't get it to work.
Calling .xml on an XmlListModel always returns an empty string for me.
This means I am passing an empty string as the XML source of modelTwo
which, obviously, doesn't work.
Is it supposed to return the raw XML data and if so what am I doing wrong?
Is it really *that* hard to parse a multilevel XML file in QML? Feel
like a complete idiot.
Regards,
-- Simon
On 16/04/15 17:01, Niklas Wenzel wrote:
> 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