<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    You should set elements position yourself. Elements itself have no
    idea where each should be placed and drawing at (0,0) position by
    default. Good idea will be to use Column as main element and place
    your text inside it. So, it should be something like:<br>
    <br>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <tt>        delegate: BackgroundItem{</tt><tt><br>
    </tt><tt>            id:delegate<br>
                  width: ListView.view.width<br>
    </tt><tt></tt><tt>            </tt><tt>height: content.height<br>
      <br>
                  Column {<br>
                      id: content<br>
                      width: parent.width<br>
    </tt><tt> </tt><tt><br>
    </tt><tt>                Text{</tt><tt><br>
                          width: parent.width<br>
    </tt><tt>                    font.pixelSize: Theme.fontSizeLarge</tt><tt><br>
    </tt><tt>                    color: Theme.primaryColor</tt><tt><br>
    </tt><tt>                    text: name<br>
                          wrapMode: Text.Wrap<br>
    </tt><tt></tt><tt>                }</tt><tt><br>
      <br>
    </tt><tt>                Text{</tt><tt><br>
                          width: parent.width<br>
    </tt><tt>                    font.pixelSize: 15</tt><tt><br>
    </tt><tt>                    color: Theme.primaryColor</tt><tt><br>
    </tt><tt>                    text: price</tt><tt><br>
                          wrapMode: Text.Wrap</tt><tt><br>
                      }</tt><tt><br>
                  }<br>
    </tt><tt>        }</tt><br>
    <br>
    <div class="moz-cite-prefix">14.05.2015 01:34, Jani Nuutinen пишет:<br>
    </div>
    <blockquote
cite="mid:CABKxMKMcjq4Kej1Qo=3yAQa7m4=WYskVvYyoZRXxYBi8koE1xw@mail.gmail.com"
      type="cite">
      <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 moz-do-not-send="true"
            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 moz-do-not-send="true"
            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 moz-do-not-send="true"
              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 moz-do-not-send="true"
                  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
                  moz-do-not-send="true"
                  href="mailto:devel-unsubscribe@lists.sailfishos.org"><a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>