Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 1301

qt-mobility-doc-1.2.0-13.mga5.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" />
<!-- qdeclarativelandmarkcategorymodel.cpp -->
  <title>Qt Mobility 1.2: QML LandmarkCategoryModel Element</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="http://qt.nokia.com/doc/4.7/qdeclarativeelements.html">QML Elements</a></li>
<li>QML LandmarkCategoryModel Element</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<p class="naviNextPrevious headerNavi">
</p><p/>
<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>
</ul>
</div>
<h1 class="title">QML LandmarkCategoryModel Element</h1>
<span class="subtitle"></span>
<!-- $$$LandmarkCategoryModel-brief -->
<p>The LandmarkCategoryModel element provides access to categories. <a href="#details">More...</a></p>
<!-- @@@LandmarkCategoryModel -->
<p>Inherits <a href="qml-landmarkabstractmodel.html">LandmarkAbstractModel</a></p>
<p>This element was introduced in  Mobility 1.2.</p>
<ul>
<li><a href="qml-landmarkcategorymodel-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-landmarkcategorymodel.html#categories-prop">categories</a></b></b> : QDeclarativeListProperty</li>
<li class="fn"><b><b><a href="qml-landmarkcategorymodel.html#landmark-prop">landmark</a></b></b> : Landmark</li>
</ul>
<!-- $$$LandmarkCategoryModel-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>This element is part of the <b>QtMobility.location 1.1</b> module.</p>
<p>LandmarkCategoryModel provides a model of categories from the categories store. The contents of the model can be specified with <a href="qml-landmarkcategorymodel.html#landmark-prop">landmark</a>, and sorted via the <a href="qml-landmarkabstractmodel.html#sortBy-prop">LandmarkAbstractModel::sortBy</a> and <a href="qml-landmarkabstractmodel.html#sortOrder-prop">LandmarkAbstractModel::sortOrder</a> properties. Whether the model is automatically updated when the store or <a href="qml-landmarkcategorymodel.html#landmark-prop">landmark</a> changes, can be controlled with <a href="qml-landmarkabstractmodel.html#autoUpdate-prop">LandmarkAbstractModel::autoUpdate</a> property.</p>
<p>There are two ways of accessing the category data: via model by using views and delegates, or alternatively via <a href="qml-landmarkcategorymodel.html#categories-prop">categories</a> list property. Of the two, the model access is preferred. Direct list access (i.e&#x2e; non-model) is not guaranteed to be in order set by sortBy and <a href="location-overview.html#sortorders">sortOrder</a>.</p>
<p>At the moment only data role provided by the model is <tt>category</tt>. Through that one can access any data provided by the <a href="qml-landmarkcategory.html">LandmarkCategory</a> element.</p>
<pre class="qml"> <span class="type">LandmarkCategoryModel</span> {
     <span class="name">id</span>: <span class="name">landmarkCategoryModel</span>
     <span class="name">autoUpdate</span>: <span class="number">true</span>
     <span class="name">onModelChanged</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="string">&quot;Category model changed, category count: &quot;</span> <span class="operator">+</span> <span class="name">count</span>)
 }

 <span class="type"><a href="qml-coordinate.html">Coordinate</a></span> {
     <span class="name">id</span>: <span class="name">initCoordinate</span>
     <span class="name">latitude</span>: -<span class="number">27.5</span>
     <span class="name">longitude</span>: <span class="number">153</span>
 }

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-component.html">Component</a></span> {
     <span class="name">id</span>: <span class="name">landmarkCategoryListDelegate</span>
     <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-item.html">Item</a></span> {
         <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">50</span>
         <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {
             <span class="name">color</span>: <span class="string">&quot;white&quot;</span>; <span class="name">font</span>.bold: <span class="number">true</span>; <span class="name">style</span>: <span class="name">Text</span>.<span class="name">Raised</span>; <span class="name">styleColor</span>: <span class="string">&quot;black&quot;</span>
             <span class="name">id</span>: <span class="name">nameField</span>; <span class="name">text</span>: <span class="name">category</span>.<span class="name">name</span>
         }
     }
 }</pre>
<p><b>See also </b><a href="qml-landmarkabstractmodel.html">LandmarkAbstractModel</a>, <a href="qml-landmarkmodel.html">LandmarkModel</a>, and <a href="qlandmarkmanager.html">QLandmarkManager</a>.</p>
<!-- @@@LandmarkCategoryModel -->
<h2>Property Documentation</h2>
<!-- $$$categories -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="categories-prop"></a><span class="qmlreadonly">read-only</span><span class="name">categories</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qdeclarativelistproperty.html">QDeclarativeListProperty</a></span></p></td></tr></table></div><div class="qmldoc"><p>This element holds the list of <a href="qml-landmarkcategory.html">LandmarkCategory</a> elements that the model currently has. Accessing categories by iterating over this list is not guaranteed to be in the order set by <a href="qml-landmarkabstractmodel.html#sortBy-prop">LandmarkAbstractModel::sortBy</a> or <a href="qml-landmarkabstractmodel.html#sortOrder-prop">LandmarkAbstractModel::sortOrder</a></p>
<pre class="qml"> <span class="type"><a href="qml-landmarkcategorymodel.html">LandmarkCategoryModel</a></span> {
     <span class="name">id</span>: <span class="name">categoriesOfGivenLandmark</span>
     <span class="name">autoUpdate</span>: <span class="number">false</span>
     <span class="name">onCategoriesChanged</span>: {
         <span class="name">console</span>.<span class="name">log</span>(<span class="string">&quot;log: Categories count is: &quot;</span><span class="operator">+</span> <span class="name">count</span>);
         <span class="keyword">for</span> (<span class="keyword">var</span> <span class="name">index</span> = <span class="number">0</span>; <span class="name">index</span> <span class="operator">&lt;</span> <span class="name">categories</span>.<span class="name">length</span>; index++)  {
             <span class="name">console</span>.<span class="name">log</span>(<span class="string">&quot;Index, name:&quot;</span> <span class="operator">+</span> <span class="name">index</span> <span class="operator">+</span> <span class="string">&quot; , &quot;</span> <span class="operator">+</span> <span class="name">categories</span>[<span class="name">index</span>].<span class="name">name</span>);
         }
     }
 }</pre>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@categories -->
<br/>
<!-- $$$landmark -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="landmark-prop"></a><span class="name">landmark</span> : <span class="type"><a href="qml-landmark.html">Landmark</a></span></p></td></tr></table></div><div class="qmldoc"><p>Landmark whose categories the model should represent. Note that the landmark needs to be from <a href="qml-landmarkmodel.html">LandmarkModel</a> because its internal category identifiers need to be set.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@landmark -->
<br/>
<p class="naviNextPrevious footerNavi">
</p>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used 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>
</div>
</body>
</html>