Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2c21526e2a037dc4eaceb3895021e482 > files > 123

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" />
<!-- qdeclarativeplaceattribute.cpp -->
  <title>ExtendedAttributes 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 >ExtendedAttributes 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="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">ExtendedAttributes QML Type</h1>
<span class="subtitle"></span>
<!-- $$$ExtendedAttributes-brief -->
<p>The <a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> type holds additional data about a <a href="qml-qtlocation-place.html">Place</a>. <a href="#details">More...</a></p>
<!-- @@@ExtendedAttributes -->
<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-extendedattributes-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtlocation-extendedattributes.html#valueChanged-signal">valueChanged</a></b></b>(string <i>key</i>,  variant <i>value</i>)</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn">variant <b><b><a href="qml-qtlocation-extendedattributes.html#keys-method">keys</a></b></b>()</li>
</ul>
<!-- $$$ExtendedAttributes-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>The <a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> type is a map of <a href="qml-qtlocation-placeattribute.html">PlaceAttributes</a>. To access attributes in the map use the <a href="qml-qtlocation-extendedattributes.html#keys-method">keys()</a> method to get the list of keys stored in the map and use the <code>[]</code> operator to access the <a href="qml-qtlocation-placeattribute.html">PlaceAttribute</a> items.</p>
<p>The following are standard keys that are defined by the API. <a href="location-places-qml.html#plugin">Plugin</a> implementations are free to define additional keys. Custom keys should be qualified by a unique prefix to avoid clashes.</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >key</th><th >description</th></tr></thead>
<tr valign="top" class="odd"><td >openingHours</td><td >The trading hours of the place</td></tr>
<tr valign="top" class="even"><td >payment</td><td >The types of payment the place accepts, for example visa, mastercard.</td></tr>
<tr valign="top" class="odd"><td >x_provider</td><td >The name of the provider that a place is sourced from</td></tr>
<tr valign="top" class="even"><td >x_id_&lt;provider&gt; (for example x_id_here)</td><td >An alternative identifier which identifies the place from the perspective of the specified provider.</td></tr>
</table></div>
<p>Some plugins may not support attributes at all, others may only support a certain set, others still may support a dynamically changing set of attributes over time or even allow attributes to be arbitrarily defined by the client application. The attributes could also vary on a place by place basis, for example one place may have opening hours while another does not. Consult the <a href="qtlocation-index.html#plugin-references-and-parameters">plugin references</a> for details.</p>
<p>Some attributes may not be intended to be readable by end users, the label field of such attributes is empty to indicate this fact.</p>
<p><b>Note: </b><a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> instances are only ever used in the context of <a href="qml-qtlocation-place.html">Place</a>s. It is not possible to create an <a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> instance directly or re-assign a <a href="qml-qtlocation-place.html">Place</a>'s <a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> property. Modification of <a href="qml-qtlocation-extendedattributes.html">ExtendedAttributes</a> can only be accomplished via Javascript.</p><p>The following example shows how to access all <a href="qml-qtlocation-placeattribute.html">PlaceAttributes</a> and print them to the console:</p>
<pre class="qml">

  import QtPositioning 5.5
  import QtLocation 5.6

  function printExtendedAttributes(extendedAttributes) {
      var keys = extendedAttributes.keys();
      for (var i = 0; i < keys.length; ++i) {
          var key = keys[i];
          if (extendedAttributes[key].label !== "")
              console.log(extendedAttributes[key].label + ": " + extendedAttributes[key].text);
      }
  }

</pre>
<p>The following example shows how to assign and modify an attribute:</p>
<pre class="qml">

      //assign a new attribute to a place
      var smokingAttrib = Qt.createQmlObject('import QtLocation 5.3; PlaceAttribute {}', place);
      smokingAttrib.label = "Smoking Allowed"
      smokingAttrib.text = "No"
      place.extendedAttributes.smoking = smokingAttrib;

      //modify an existing attribute
      place.extendedAttributes.smoking.text = "Yes"

</pre>
<p><b>See also </b><a href="qml-qtlocation-placeattribute.html">PlaceAttribute</a> and QQmlPropertyMap.</p>
<!-- @@@ExtendedAttributes -->
<h2>Signal Documentation</h2>
<!-- $$$valueChanged -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="valueChanged-signal">
<td class="tblQmlFuncNode"><p>
<a name="valueChanged-signal"></a><span class="type">void</span> <span class="name">valueChanged</span>(<span class="type">string</span> <i>key</i>,  <span class="type">variant</span> <i>value</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when the set of attributes changes. <i>key</i> is the key corresponding to the <i>value</i> that was changed.</p>
<p>The corresponding handler is <code>onValueChanged</code>.</p>
</div></div><!-- @@@valueChanged -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$keys -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="keys-method">
<td class="tblQmlFuncNode"><p>
<a name="keys-method"></a><span class="type">variant</span> <span class="name">keys</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns an array of place attribute keys currently stored in the map.</p>
</div></div><!-- @@@keys -->
<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>