<div dir="ltr">Thank you for the generous insights gents.<div><br></div><div>While I'm still learning from ground up these simplest things with Qt delegate was the thing here to get some flesh on the bones (as in: getting something to show up on the emulator screen).</div><div>The first code I used did work so I merely did expand on top of that with another "code training".</div><div><br></div><div>This time the new code has two XmlRole elements: one for the "name" of products and the other for the "price" of the products. If I pass these two through the delegate component the data seems to overlap on the emulator screen.</div><div>What is the correct way through the means of coding to change the relative position of those two (or even multiple) elements?</div><div><br></div><div>Code in pastebin this time:</div><div><br></div><div><a href="http://pastebin.com/3ftxPyvk">http://pastebin.com/3ftxPyvk</a><br></div><div><br></div><div><br></div><div>XML:</div><div><br></div><div><a href="http://www.w3schools.com/xml/simple.xml">http://www.w3schools.com/xml/simple.xml</a><br></div><div><br></div><div><br></div><div>Greetings</div><div><br></div><div>Jani</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 13, 2015 at 9:15 PM, Michael Fuchs <span dir="ltr"><<a href="mailto:michfu@gmx.at" target="_blank">michfu@gmx.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jani,<br>
<br>
As somebody else wrote: JSON is the native data format for QML.<br>
<br>
I'm using XMLHttpRequest and JSON.parse() for my project.<br>
Maybe this is something for you.<br>
<br>
greets,<br>
Michael.<br>
<div><div class="h5"><br>
On Tuesday 12 May 2015 22:58:16 Jani Nuutinen wrote:<br>
> I'm trying early on to familiarize myself with passing data to the phone<br>
> from the Internet and just for starters I chose to use a simple XML-file to<br>
> see if I could make something out myself. I do not know if using XML from<br>
> Internet source is the simplest or the smartest method, but trying to<br>
> follow the scarce tutorials about passing XML data didn't seem to be that<br>
> challenging.<br>
><br>
> Code:<br>
><br>
> import QtQuick 2.0<br>
><br>
> import Sailfish.Silica 1.0<br>
><br>
> import QtQuick.XmlListModel 2.0<br>
><br>
><br>
> Page{<br>
><br>
>     id: root<br>
><br>
><br>
>     XmlListModel{<br>
><br>
>         id:noteXml<br>
><br>
>         source:"<a href="http://www.w3schools.com/xml/note.xml" target="_blank">http://www.w3schools.com/xml/note.xml</a>"<br>
><br>
>         query:"/note"<br>
><br>
>         XmlRole{name: "body"; query: "body/string()"}<br>
><br>
>     }<br>
><br>
><br>
>     SilicaListView{<br>
><br>
>          id:noteView<br>
><br>
>          width: parent.width<br>
><br>
>          height: parent.height<br>
><br>
>          anchors.centerIn: parent<br>
><br>
><br>
>          header: PageHeader{<br>
><br>
>              title: "Note"<br>
><br>
>          }<br>
><br>
><br>
>          model:noteXml<br>
><br>
>          }<br>
><br>
>     }<br>
><br>
><br>
><br>
> I've tried few other approaches but to me this seems the simplest<br>
> method "coding wise". The app starts (in the emulator) as it should<br>
</div></div>> and without errors, showing the first page with *Note* as the title.<br>
<span class="im HOEnZb">> But no matter how much I'd like the XML getting passed on to the phone<br>
> screen from the provided URL it never does.<br>
><br>
><br>
> So I'm wondering what am I missing that should be included to get such<br>
> a simple thing working?<br>
><br>
><br>
><br>
> Greetings<br>
><br>
><br>
> Asmodeus<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br>
</div></div></blockquote></div><br></div>