Sophie

Sophie

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

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" />
<!-- qdeclarativevaluespacepublisher.cpp -->
  <title>Qt Mobility 1.2: QML ValueSpacePublisher 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 ValueSpacePublisher Element</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="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML ValueSpacePublisher Element</h1>
<span class="subtitle"></span>
<!-- $$$ValueSpacePublisher-brief -->
<p>The ValueSpacePublisher element represents a path in the value space where keys can be published. <a href="#details">More...</a></p>
<!-- @@@ValueSpacePublisher -->
<p>This element was introduced in  Mobility 1.2.</p>
<ul>
<li><a href="qml-valuespacepublisher-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-valuespacepublisher.html#hasSubscribers-prop">hasSubscribers</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-valuespacepublisher.html#keys-prop">keys</a></b></b> : QStringList</li>
<li class="fn"><b><b><a href="qml-valuespacepublisher.html#path-prop">path</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-valuespacepublisher.html#server-prop">server</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-valuespacepublisher.html#value-prop">value</a></b></b> : QVariant</li>
</ul>
<!-- $$$ValueSpacePublisher-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>ValueSpacePublishers are constructed with a set <i>path</i> which cannot be changed. If you need to publish within multiple different paths, you will need multiple ValueSpacePublishers.</p>
<p>For the keys within the path chosen, if the key names to be published are alphanumeric, they may be accessed through dynamic properties by setting the <i>keys</i> list.</p>
<p>Example:</p>
<pre class="cpp"> ValueSpacePublisher {
     id: battery
     path: <span class="string">&quot;/power/battery&quot;</span>
     keys: <span class="operator">[</span><span class="string">&quot;charge&quot;</span><span class="operator">,</span> <span class="string">&quot;charging&quot;</span><span class="operator">]</span>
 }

 MouseArea {
     onClicked: {
         battery<span class="operator">.</span>charge <span class="operator">=</span> <span class="number">50</span>
         battery<span class="operator">.</span>charging <span class="operator">=</span> <span class="keyword">true</span>
     }
 }</pre>
<p>Alternatively, for key names that can't be mapped to properties, or for key names shadowed by existing properties (like &quot;value&quot; or &quot;path&quot;), you can also access the <i>value</i> property of the Publisher itself.</p>
<pre class="cpp"> ValueSpacePublisher {
     id: nonalpha
     path: <span class="string">&quot;/something/with a space/value&quot;</span>
 }

 MouseArea {
     onClicked: {
         nonalpha<span class="operator">.</span>value <span class="operator">=</span> <span class="string">&quot;example&quot;</span>
     }
 }</pre>
<p>The ValueSpacePublisher element is part of the <b>QtMobility.publishsubscribe 1.2</b> module.</p>
<p><b>See also </b><a href="qvaluespacepublisher.html">QValueSpacePublisher</a>.</p>
<!-- @@@ValueSpacePublisher -->
<h2>Property Documentation</h2>
<!-- $$$hasSubscribers -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="hasSubscribers-prop"></a><span class="qmlreadonly">read-only</span><span class="name">hasSubscribers</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property is true if there are subscribers currently subscribed to the ValueSpace path being published by this Publisher.</p>
<p>This property is read only.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@hasSubscribers -->
<br/>
<!-- $$$keys -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="keys-prop"></a><span class="name">keys</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstringlist.html">QStringList</a></span></p></td></tr></table></div><div class="qmldoc"><p>Setting this property creates a set of dynamic properties allowing easy access to set the values of keys under this Publisher's path.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@keys -->
<br/>
<!-- $$$path -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="path-prop"></a><span class="name">path</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the base path of the publisher. This property is write-once -- after the first write, subsequent writes will be ignored and produce a warning.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@path -->
<br/>
<!-- $$$server -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="server-prop"></a><span class="name">server</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property can be used to force the Publisher to start the ValueSpace server (if one is appropriate on the platform) before the <i>path</i> property has been set.</p>
<p>This property is write only.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@server -->
<br/>
<!-- $$$value -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="value-prop"></a><span class="name">value</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qvariant.html">QVariant</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property publishes a new value to the ValueSpace at the path given through the <i>path</i> property. This property is write only.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@value -->
<br/>
  <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>