Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6001

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdeclarativexmllistmodel.cpp -->
  <title>Qt 4.8: QML XmlListModel Element</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li>QML XmlListModel Element</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#using-key-xml-roles">Using key XML roles</a></li>
</ul>
</div>
<h1 class="title">QML XmlListModel Element</h1>
<span class="subtitle"></span>
<!-- $$$XmlListModel-brief -->
<p>The XmlListModel element is used to specify a read-only model using XPath expressions. <a href="#details">More...</a></p>
<!-- @@@XmlListModel -->
<p>This element was introduced in Qt 4.7.</p>
<ul>
<li><a href="qml-xmllistmodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#count-prop">count</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#namespaceDeclarations-prop">namespaceDeclarations</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#progress-prop">progress</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#query-prop">query</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#roles-prop">roles</a></b></b> : list&lt;XmlRole&gt;</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#source-prop">source</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#status-prop">status</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#xml-prop">xml</a></b></b> : string</li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#errorString-method">errorString</a></b></b></li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#get-method">get</a></b></b></li>
<li class="fn"><b><b><a href="qml-xmllistmodel.html#reload-method">reload</a></b></b></li>
</ul>
<!-- $$$XmlListModel-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>XmlListModel is used to create a read-only model from XML data. It can be used as a data source for view elements (such as <a href="qml-listview.html">ListView</a>, <a href="qml-pathview.html">PathView</a>, <a href="qml-gridview.html">GridView</a>) and other elements that interact with model data (such as <a href="qml-repeater.html">Repeater</a>).</p>
<p>For example, if there is a XML document at http://www.mysite.com/feed.xml like this:</p>
<pre class="cpp"> <span class="operator">&lt;</span><span class="operator">?</span>xml version<span class="operator">=</span><span class="string">&quot;1.0&quot;</span> encoding<span class="operator">=</span><span class="string">&quot;utf-8&quot;</span><span class="operator">?</span><span class="operator">&gt;</span>
 <span class="operator">&lt;</span>rss version<span class="operator">=</span><span class="string">&quot;2.0&quot;</span><span class="operator">&gt;</span>
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="operator">&lt;</span>channel<span class="operator">&gt;</span>
         <span class="operator">&lt;</span>item<span class="operator">&gt;</span>
             <span class="operator">&lt;</span>title<span class="operator">&gt;</span>A blog post<span class="operator">&lt;</span><span class="operator">/</span>title<span class="operator">&gt;</span>
             <span class="operator">&lt;</span>pubDate<span class="operator">&gt;</span>Sat<span class="operator">,</span> <span class="number">07</span> Sep <span class="number">2010</span> <span class="number">10</span>:<span class="number">00</span>:<span class="number">01</span> GMT<span class="operator">&lt;</span><span class="operator">/</span>pubDate<span class="operator">&gt;</span>
         <span class="operator">&lt;</span><span class="operator">/</span>item<span class="operator">&gt;</span>
         <span class="operator">&lt;</span>item<span class="operator">&gt;</span>
             <span class="operator">&lt;</span>title<span class="operator">&gt;</span>Another blog post<span class="operator">&lt;</span><span class="operator">/</span>title<span class="operator">&gt;</span>
             <span class="operator">&lt;</span>pubDate<span class="operator">&gt;</span>Sat<span class="operator">,</span> <span class="number">07</span> Sep <span class="number">2010</span> <span class="number">15</span>:<span class="number">35</span>:<span class="number">01</span> GMT<span class="operator">&lt;</span><span class="operator">/</span>pubDate<span class="operator">&gt;</span>
         <span class="operator">&lt;</span><span class="operator">/</span>item<span class="operator">&gt;</span>
     <span class="operator">&lt;</span><span class="operator">/</span>channel<span class="operator">&gt;</span>
 <span class="operator">&lt;</span><span class="operator">/</span>rss<span class="operator">&gt;</span></pre>
<p>A XmlListModel could create a model from this data, like this:</p>
<pre class="qml"> import QtQuick 1.0

 <span class="type">XmlListModel</span> {
     <span class="name">id</span>: <span class="name">xmlModel</span>
     <span class="name">source</span>: <span class="string">&quot;http://www.mysite.com/feed.xml&quot;</span>
     <span class="name">query</span>: <span class="string">&quot;/rss/channel/item&quot;</span>

     <span class="type"><a href="qml-xmlrole.html">XmlRole</a></span> { <span class="name">name</span>: <span class="string">&quot;title&quot;</span>; <span class="name">query</span>: <span class="string">&quot;title/string()&quot;</span> }
     <span class="type"><a href="qml-xmlrole.html">XmlRole</a></span> { <span class="name">name</span>: <span class="string">&quot;pubDate&quot;</span>; <span class="name">query</span>: <span class="string">&quot;pubDate/string()&quot;</span> }
 }</pre>
<p>The <a href="qml-xmllistmodel.html#query-prop">query</a> value of &quot;/rss/channel/item&quot; specifies that the XmlListModel should generate a model item for each <tt>&lt;item&gt;</tt> in the XML document.</p>
<p>The <a href="qml-xmlrole.html">XmlRole</a> objects define the model item attributes. Here, each model item will have <tt>title</tt> and <tt>pubDate</tt> attributes that match the <tt>title</tt> and <tt>pubDate</tt> values of its corresponding <tt>&lt;item&gt;</tt>. (See <a href="qml-xmlrole.html#query-prop">XmlRole::query</a> for more examples of valid XPath expressions for <a href="qml-xmlrole.html">XmlRole</a>.)</p>
<p>The model could be used in a <a href="qml-listview.html">ListView</a>, like this:</p>
<pre class="qml"> <span class="type"><a href="qml-listview.html">ListView</a></span> {
     <span class="name">width</span>: <span class="number">180</span>; <span class="name">height</span>: <span class="number">300</span>
     <span class="name">model</span>: <span class="name">xmlModel</span>
     <span class="name">delegate</span>: <span class="name">Text</span> { <span class="name">text</span>: <span class="name">title</span> <span class="operator">+</span> <span class="string">&quot;: &quot;</span> <span class="operator">+</span> <span class="name">pubDate</span> }
 }</pre>
<p class="centerAlign"><img src="images/qml-xmllistmodel-example.png" alt="" /></p><p>The XmlListModel data is loaded asynchronously, and <a href="qml-xmllistmodel.html#status-prop">status</a> is set to <tt>XmlListModel.Ready</tt> when loading is complete. Note this means when XmlListModel is used for a view, the view is not populated until the model is loaded.</p>
<a name="using-key-xml-roles"></a>
<h3>Using key XML roles</h3>
<p>You can define certain roles as &quot;keys&quot; so that when <a href="qml-xmllistmodel.html#reload-method">reload()</a> is called, the model will only add and refresh data that contains new values for these keys.</p>
<p>For example, if above role for &quot;pubDate&quot; was defined like this instead:</p>
<pre class="qml">     <span class="type"><a href="qml-xmlrole.html">XmlRole</a></span> { <span class="name">name</span>: <span class="string">&quot;pubDate&quot;</span>; <span class="name">query</span>: <span class="string">&quot;pubDate/string()&quot;</span>; <span class="name">isKey</span>: <span class="number">true</span> }</pre>
<p>Then when <a href="qml-xmllistmodel.html#reload-method">reload()</a> is called, the model will only add and reload items with a &quot;pubDate&quot; value that is not already present in the model.</p>
<p>This is useful when displaying the contents of XML documents that are incrementally updated (such as RSS feeds) to avoid repainting the entire contents of a model in a view.</p>
<p>If multiple key roles are specified, the model only adds and reload items with a combined value of all key roles that is not already present in the model.</p>
<p><b>See also </b><a href="demos-declarative-rssnews.html">RSS News</a>.</p>
<!-- @@@XmlListModel -->
<h2>Property Documentation</h2>
<!-- $$$count -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="count-prop"></a><span class="qmlreadonly">read-only</span><span class="name">count</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>The number of data entries in the model.</p>
</div></div><!-- @@@count -->
<br/>
<!-- $$$namespaceDeclarations -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="namespaceDeclarations-prop"></a><span class="name">namespaceDeclarations</span> : <span class="type"><a href="qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>The namespace declarations to be used in the XPath queries.</p>
<p>The namespaces should be declared as in <a href="xmlprocessing.html">XQuery</a>. For example, if a requested document at http://mysite.com/feed.xml uses the namespace &quot;http://www.w3.org/2005/Atom&quot;, this can be declared as the default namespace:</p>
<pre class="qml"> <span class="type"><a href="qml-xmllistmodel.html">XmlListModel</a></span> {
     <span class="name">source</span>: <span class="string">&quot;http://mysite.com/feed.xml&quot;</span>
     <span class="name">query</span>: <span class="string">&quot;/feed/entry&quot;</span>
     <span class="name">namespaceDeclarations</span>: <span class="string">&quot;declare default element namespace 'http://www.w3.org/2005/Atom';&quot;</span>

     <span class="type"><a href="qml-xmlrole.html">XmlRole</a></span> { <span class="name">name</span>: <span class="string">&quot;title&quot;</span>; <span class="name">query</span>: <span class="string">&quot;title/string()&quot;</span> }
 }</pre>
</div></div><!-- @@@namespaceDeclarations -->
<br/>
<!-- $$$progress -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="progress-prop"></a><span class="qmlreadonly">read-only</span><span class="name">progress</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>This indicates the current progress of the downloading of the XML data source. This value ranges from 0.0 (no data downloaded) to 1.0 (all data downloaded). If the XML data is not from a remote source, the progress becomes 1.0 as soon as the data is read.</p>
<p>Note that when the progress is 1.0, the XML data has been downloaded, but it is yet to be loaded into the model at this point. Use the status property to find out when the XML data has been read and loaded into the model.</p>
<p><b>See also </b><a href="qml-xmllistmodel.html#status-prop">status</a> and <a href="qml-xmllistmodel.html#source-prop">source</a>.</p>
</div></div><!-- @@@progress -->
<br/>
<!-- $$$query -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="query-prop"></a><span class="name">query</span> : <span class="type"><a href="qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>An absolute XPath query representing the base query for creating model items from this model's <a href="qml-xmlrole.html">XmlRole</a> objects. The query should start with '/' or '//'.</p>
</div></div><!-- @@@query -->
<br/>
<!-- $$$roles -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="roles-prop"></a><span class="qmlreadonly">read-only</span><span class="name">roles</span> : <span class="type"><a href="qml-list.html">list</a></span>&lt;<span class="type"><a href="qml-xmlrole.html">XmlRole</a></span>&gt;</p></td></tr></table></div><div class="qmldoc"><p>The roles to make available for this model.</p>
</div></div><!-- @@@roles -->
<br/>
<!-- $$$source -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="source-prop"></a><span class="name">source</span> : <span class="type"><a href="qml-url.html">url</a></span></p></td></tr></table></div><div class="qmldoc"><p>The location of the XML data source.</p>
<p>If both <tt>source</tt> and <a href="qml-xmllistmodel.html#xml-prop">xml</a> are set, <a href="qml-xmllistmodel.html#xml-prop">xml</a> is used.</p>
</div></div><!-- @@@source -->
<br/>
<!-- $$$status -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="status-prop"></a><span class="qmlreadonly">read-only</span><span class="name">status</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Specifies the model loading status, which can be one of the following:</p>
<ul>
<li><a href="qml-xmllistmodel.html">XmlListModel</a>.Null - No XML data has been set for this model.</li>
<li><a href="qml-xmllistmodel.html">XmlListModel</a>.Ready - The XML data has been loaded into the model.</li>
<li><a href="qml-xmllistmodel.html">XmlListModel</a>.Loading - The model is in the process of reading and loading XML data.</li>
<li><a href="qml-xmllistmodel.html">XmlListModel</a>.Error - An error occurred while the model was loading. See <a href="qml-xmllistmodel.html#errorString-method">errorString()</a> for details about the error.</li>
</ul>
<p><b>See also </b><a href="qml-xmllistmodel.html#progress-prop">progress</a>.</p>
</div></div><!-- @@@status -->
<br/>
<!-- $$$xml -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="xml-prop"></a><span class="name">xml</span> : <span class="type"><a href="qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the XML data for this model, if set.</p>
<p>The text is assumed to be UTF-8 encoded.</p>
<p>If both <a href="qml-xmllistmodel.html#source-prop">source</a> and <tt>xml</tt> are set, <tt>xml</tt> is used.</p>
</div></div><!-- @@@xml -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$errorString -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="errorString-method"></a><span class="type">void</span> XmlListModel::<span class="name">errorString</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Returns a string description of the last error that occurred if <a href="qml-xmllistmodel.html#status-prop">status</a> is XmlListModel::Error.</p>
</div></div><!-- @@@errorString -->
<br/>
<!-- $$$get -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="get-method"></a><span class="type">object</span> XmlListModel::<span class="name">get</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>index</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns the item at <i>index</i> in the model.</p>
<p>For example, for a model like this:</p>
<pre class="qml"> <span class="type"><a href="qml-xmllistmodel.html">XmlListModel</a></span> {
     <span class="name">id</span>: <span class="name">model</span>
     <span class="name">source</span>: <span class="string">&quot;http://mysite.com/feed.xml&quot;</span>
     <span class="name">query</span>: <span class="string">&quot;/feed/entry&quot;</span>
     <span class="type"><a href="qml-xmlrole.html">XmlRole</a></span> { <span class="name">name</span>: <span class="string">&quot;title&quot;</span>; <span class="name">query</span>: <span class="string">&quot;title/string()&quot;</span> }
 }</pre>
<p>This will access the <tt>title</tt> value for the first item in the model:</p>
<pre class="js"> var <span class="name">title</span> = <span class="name">model</span>.<span class="name">get</span>(<span class="number">0</span>).<span class="name">title</span>;</pre>
</div></div><!-- @@@get -->
<br/>
<!-- $$$reload -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="reload-method"></a>XmlListModel::<span class="name">reload</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Reloads the model.</p>
<p>If no key roles have been specified, all existing model data is removed, and the model is rebuilt from scratch.</p>
<p>Otherwise, items are only added if the model does not already contain items with matching key role values.</p>
<p><b>See also </b><a href="qml-xmllistmodel.html#using-key-xml-roles">Using key XML roles</a> and <a href="qml-xmlrole.html#isKey-prop">XmlRole::isKey</a>.</p>
</div></div><!-- @@@reload -->
<br/>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>