Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2c21526e2a037dc4eaceb3895021e482 > files > 129

qtlocation5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdeclarativeplaceimagemodel.cpp -->
  <title>ImageModel QML Type | Qt Location 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtlocation-index.html">Qt Location</a></td><td ><a href="qtlocation-qmlmodule.html">QML Types</a></td><td >ImageModel QML Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtlocation-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#details">Detailed Description</a></li>
<li class="level2"><a href="#example">Example</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">ImageModel QML Type</h1>
<span class="subtitle"></span>
<!-- $$$ImageModel-brief -->
<p>The <a href="qml-qtlocation-imagemodel.html">ImageModel</a> type provides a model of place images. <a href="#details">More...</a></p>
<!-- @@@ImageModel -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtLocation 5.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  QtLocation 5.5</td></tr></table></div><ul>
<li><a href="qml-qtlocation-imagemodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtlocation-imagemodel.html#batchSize-prop">batchSize</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtlocation-imagemodel.html#place-prop">place</a></b></b> : Place</li>
<li class="fn"><b><b><a href="qml-qtlocation-imagemodel.html#totalCount-prop">totalCount</a></b></b> : int</li>
</ul>
<!-- $$$ImageModel-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>The <a href="qml-qtlocation-imagemodel.html">ImageModel</a> is a read-only model used to fetch images related to a <a href="qml-qtlocation-place.html">Place</a>. Binding a <a href="qml-qtlocation-place.html">Place</a> via <a href="qml-qtlocation-imagemodel.html#place-prop">ImageModel::place</a> initiates an initial fetch of images. The model performs fetches incrementally and is intended to be used in conjunction with a View such as a ListView. When the View reaches the last of the images currently in the model, a fetch is performed to retrieve more if they are available. The View is automatically updated as the images are received. The number of images which are fetched at a time is specified by the <a href="qml-qtlocation-imagemodel.html#batchSize-prop">batchSize</a> property. The total number of images available can be accessed via the <a href="qml-qtlocation-imagemodel.html#totalCount-prop">totalCount</a> property.</p>
<p>The model returns data for the following roles:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Role</th><th >Type</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >url</td><td >url</td><td >The URL of the image.</td></tr>
<tr valign="top" class="even"><td >imageId</td><td >string</td><td >The identifier of the image.</td></tr>
<tr valign="top" class="odd"><td >mimeType</td><td >string</td><td >The MIME type of the image.</td></tr>
<tr valign="top" class="even"><td >supplier</td><td ><a href="qml-qtlocation-supplier.html">Supplier</a></td><td >The supplier of the image.</td></tr>
<tr valign="top" class="odd"><td >user</td><td ><a href="qml-qtlocation-user.html">User</a></td><td >The user who contributed the image.</td></tr>
<tr valign="top" class="even"><td >attribution</td><td >string</td><td >Attribution text which must be displayed when displaying the image.</td></tr>
</table></div>
<a name="example"></a>
<h2 id="example">Example</h2>
<p>The following example shows how to display images for a place:</p>
<pre class="qml">

  import QtQuick 2.0
  import QtPositioning 5.5
  import QtLocation 5.6

  ImageModel {
      id: imageModel
      batchSize: 3
      place: place
  }

  ListView {
      anchors.top: parent.top
      width: parent.width
      spacing: 10

      model: imageModel
      orientation: ListView.Horizontal
      snapMode: ListView.SnapOneItem

      delegate: Item {
          width: listView.width
          height: listView.height

          Image {
              anchors.fill: parent
              source: url
              fillMode: Image.PreserveAspectFit
          }

          Text {
              text: supplier.name + "\n" + supplier.url
              width: parent.width
              anchors.bottom: parent.bottom
          }
      }
  }

</pre>
<!-- @@@ImageModel -->
<h2>Property Documentation</h2>
<!-- $$$batchSize -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="batchSize-prop">
<td class="tblQmlPropNode"><p>
<a name="batchSize-prop"></a><span class="name">batchSize</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the batch size to use when fetching more image items.</p>
</div></div><!-- @@@batchSize -->
<br/>
<!-- $$$place -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="place-prop">
<td class="tblQmlPropNode"><p>
<a name="place-prop"></a><span class="name">place</span> : <span class="type"><a href="qml-qtlocation-place.html">Place</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the Place that the images are for.</p>
</div></div><!-- @@@place -->
<br/>
<!-- $$$totalCount -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="totalCount-prop">
<td class="tblQmlPropNode"><p>
<a name="totalCount-prop"></a><span class="name">totalCount</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the total number of image items for the place.</p>
</div></div><!-- @@@totalCount -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    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. </p>
</div>
</body>
</html>