<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1431460684193_9646">In the SilicaListView add: </div><div id="yui_3_16_0_1_1431460684193_9647"><br></div><div id="yui_3_16_0_1_1431460684193_9633"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">delegate</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">Text</span><span style="color: rgb(192, 192, 192);"> </span>{<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">text</span>:<span style="color: rgb(192, 192, 192);"> </span>body}
</div><pre id="yui_3_16_0_1_1431460684193_9616" style="margin: 0px; text-indent: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty;"><br></pre><pre id="yui_3_16_0_1_1431460684193_9622" style="margin: 0px; text-indent: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty;">And the text will be shown</pre><pre id="yui_3_16_0_1_1431460684193_9621" style="margin: 0px; text-indent: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty;"><br> </pre><div id="yui_3_16_0_1_1431460684193_9388" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;"> <div id="yui_3_16_0_1_1431460684193_9387" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1431460684193_9386" dir="ltr"> <hr size="1" id="yui_3_16_0_1_1431460684193_9385"> <font id="yui_3_16_0_1_1431460684193_9404" face="Arial" size="2"> <b><span style="font-weight: bold;">From:</span></b> Andrey Kozhevnikov <coderusinbox@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> devel@lists.sailfishos.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, May 12, 2015 9:59 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [SailfishDevel] Getting simple XML to show on the emulator<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1431460684193_9402"><br><div id="yiv3996134730"><div id="yui_3_16_0_1_1431460684193_9401">
Using XML is not simplest for QML. Native data format for
QML/JavaScript is JSON.<br clear="none">
<br clear="none">
<div class="yiv3996134730moz-cite-prefix" id="yui_3_16_0_1_1431460684193_9403">13.05.2015 00:58, Jani Nuutinen пишет:<br clear="none">
</div>
<blockquote id="yui_3_16_0_1_1431460684193_9400" type="cite">
<div class="qtdSeparateBR"><br><br></div><div class="yiv3996134730yqt7997072177" id="yiv3996134730yqt90729"><div id="yui_3_16_0_1_1431460684193_9399" dir="ltr">I'm trying early on to familiarize myself with
passing data to the phone from the Internet and just for
starters I chose to use a simple XML-file to see if I could make
something out myself. I do not know if using XML from Internet
source is the simplest or the smartest method, but trying to
follow the scarce tutorials about passing XML data didn't seem
to be that challenging.
<div id="yui_3_16_0_1_1431460684193_9509"><br clear="none">
</div>
<div id="yui_3_16_0_1_1431460684193_9398">Code:</div>
<div id="yui_3_16_0_1_1431460684193_9508"><br clear="none">
</div>
<div id="yui_3_16_0_1_1431460684193_9412">
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre id="yui_3_16_0_1_1431460684193_9612" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">import</span><span style="color: rgb(192, 192, 192);"> </span>QtQuick<span style="color: rgb(192, 192, 192);"> </span>2.0</pre><pre id="yui_3_16_0_1_1431460684193_9611" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">import</span><span style="color: rgb(192, 192, 192);"> </span>Sailfish.Silica<span style="color: rgb(192, 192, 192);"> </span>1.0</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">import</span><span style="color: rgb(192, 192, 192);"> </span>QtQuick.XmlListModel<span style="color: rgb(192, 192, 192);"> </span>2.0</pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 0, 128);">Page</span>{</pre><pre id="yui_3_16_0_1_1431460684193_9411" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">id</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0); font-style: italic;">root</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre id="yui_3_16_0_1_1431460684193_9413" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">XmlListModel</span>{</pre><pre id="yui_3_16_0_1_1431460684193_9414" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">id</span>:<span style="color: rgb(0, 0, 0); font-style: italic;">noteXml</span></pre><pre id="yui_3_16_0_1_1431460684193_9417" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">source</span>:<span id="yui_3_16_0_1_1431460684193_9416" style="color: rgb(0, 128, 0);">"<a id="yui_3_16_0_1_1431460684193_9415" href="http://www.w3schools.com/xml/note.xml" target="_blank" rel="nofollow" shape="rect">http://www.w3schools.com/xml/note.xml</a>"</span></pre><pre id="yui_3_16_0_1_1431460684193_9510" style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">query</span>:<span style="color: rgb(0, 128, 0);">"/note"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">XmlRole</span>{<span style="color: rgb(128, 0, 0);">name</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"body"</span>;<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">query</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"body/string()"</span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">SilicaListView</span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">id</span>:<span style="color: rgb(0, 0, 0); font-style: italic;">noteView</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">width</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0); font-style: italic;">parent</span>.width</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">height</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0); font-style: italic;">parent</span>.height</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);">
</span><span style="color: rgb(128, 0, 0);">anchors.centerIn</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0); font-style: italic;">parent</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">header</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">PageHeader</span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">title</span>:<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Note"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">model</span>:<span style="color: rgb(0, 0, 0); font-style: italic;">noteXml</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;">I've tried few other approaches but to me this seems the simplest method "coding wise". The app starts (in the emulator) as it should and without errors, showing the first page with <i>Note</i> as the title. But no matter how much I'd like the XML getting passed on to the phone screen from the provided URL it never does.</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;">So I'm wondering what am I missing that should be included to get such a simple thing working?</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;">Greetings</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;">Asmodeus</pre>
</div>
</div></div>
<br clear="none">
<fieldset class="yiv3996134730mimeAttachmentHeader"></fieldset>
<br clear="none">
<pre>_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="yiv3996134730moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank" rel="nofollow" shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
</blockquote>
<br clear="none">
</div></div><br><div class="yqt7997072177" id="yqt51529">_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></div><br><br></div> </div> </div> </div></body></html>