Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 9026c9fecbedd778b04292bd6f2d9049 > files > 91

qtxmlpatterns5-doc-5.9.4-1.mga6.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" />
<!-- qabstractxmlnodemodel.cpp -->
  <title>QXmlNodeModelIndex Class | Qt XML Patterns 5.9</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.9</td><td ><a href="qtxmlpatterns-index.html">Qt XML Patterns</a></td><td ><a href="qtxmlpatterns-module.html">C++ Classes</a></td><td >QXmlNodeModelIndex</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</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="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</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">QXmlNodeModelIndex Class</h1>
<!-- $$$QXmlNodeModelIndex-brief -->
<p>The <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> class identifies a node in an XML node model subclassed from <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>. <a href="#details">More...</a></p>
<!-- @@@QXmlNodeModelIndex -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QXmlNodeModelIndex&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += xmlpatterns</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr></table></div><ul>
<li><a href="qxmlnodemodelindex-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#DocumentOrder-enum">DocumentOrder</a></b> { Precedes, Follows, Is }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#List-typedef">List</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#NodeKind-enum">NodeKind</a></b> { Attribute, Text, Comment, Document, ..., ProcessingInstruction }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#QXmlNodeModelIndex">QXmlNodeModelIndex</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#QXmlNodeModelIndex-1">QXmlNodeModelIndex</a></b>(const QXmlNodeModelIndex &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#additionalData">additionalData</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#data">data</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void *</td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#internalPointer">internalPointer</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#isNull">isNull</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QAbstractXmlNodeModel *</td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#model">model</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#operator-not-eq">operator!=</a></b>(const QXmlNodeModelIndex &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlnodemodelindex.html#operator-eq-eq">operator==</a></b>(const QXmlNodeModelIndex &amp;<i>other</i>) const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QXmlNodeModelIndex-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> class identifies a node in an XML node model subclassed from <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> is an index into an <a href="qabstractxmlnodemodel.html">XML node model</a>. It contains:</p>
<ul>
<li>A pointer to an <a href="qabstractxmlnodemodel.html">XML node model</a>, which is returned by <a href="qxmlnodemodelindex.html#model">model</a>(), and</li>
<li>Some data, which is returned by <a href="qxmlnodemodelindex.html#data">data</a>(), <a href="qxmlnodemodelindex.html#internalPointer">internalPointer</a>(), and <a href="qxmlnodemodelindex.html#additionalData">additionalData</a>().</li>
</ul>
<p>Because <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> is intentionally a simple class, it doesn't have member functions for accessing the properties of nodes. For example, it doesn't have functions for getting a node's name or its list of attributes or child nodes. If you find that you need to retrieve this kind of information from your query results, there are two ways to proceed.</p>
<ul>
<li>Send the output of your <a href="xmlprocessing.html">XQuery</a> to an <a href="qabstractxmlreceiver.html">XML receiver</a>, or</li>
<li>Let your <a href="xmlprocessing.html">XQuery</a> do all the work to produce the desired result.</li>
</ul>
<p>The second case is explained by example. Suppose you want to populate a list widget with the values of certain attributes from a set of result elements. You could write an <a href="xmlprocessing.html">XQuery</a> to return the set of elements, and then you would write the code to iterate over the result elements, get their attributes, and extract the desired string values. But the simpler way is to just augment your <a href="xmlprocessing.html">XQuery</a> to finding the desired attribute values. Then all you have to do is evaluate the <a href="xmlprocessing.html">XQuery</a> using the version of <a href="qxmlquery.html#evaluateTo">QXmlQuery::evaluateTo</a>() that populates a QStringList, which you can send directly to your widget.</p>
<p><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> doesn't impose any restrictions on the <code>data</code> value an <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> should contain. The meaning of the data left to the associated <a href="qabstractxmlnodemodel.html">node model</a>. Because <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> depends on a particular subclass of <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> for its existence, the only way you can create an instance of <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> is by asking the node model to create one for you with <a href="qabstractxmlnodemodel.html#createIndex">QAbstractXmlNodeModel::createIndex</a>(). Since that function is protected, it is usually a good idea to write a public function that creates a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> from arguments that are appropriate for your particular node model.</p>
<p>A default constructed node index is said to be null, i.e&#x2e;, <a href="qxmlnodemodelindex.html#isNull">isNull</a>() returns true.</p>
<p><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> and <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> follow the same design pattern used for QModelIndex and QAbstractItemModel.</p>
</div>
<!-- @@@QXmlNodeModelIndex -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DocumentOrder$$$Precedes$$$Is$$$Follows -->
<h3 class="fn" id="DocumentOrder-enum"><a name="DocumentOrder-enum"></a>enum QXmlNodeModelIndex::<span class="name">DocumentOrder</span></h3>
<p>Identifies the specific node comparison operator that should be used.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Precedes</code></td><td class="topAlign tblval"><code>-1</code></td><td class="topAlign">Signifies the <code>\&lt;\&lt;</code> operator. Test whether the first operand precedes the second in the document.</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Follows</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Signifies the <code>\&gt;\&gt;</code> operator. Test whether the first operand follows the second in the document.</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Is</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Signifies the <code>is</code> operator. Test whether two nodes have the same node identity.</td></tr>
</table></div>
<!-- @@@DocumentOrder -->
<!-- $$$List -->
<h3 class="fn" id="List-typedef"><a name="List-typedef"></a>typedef QXmlNodeModelIndex::<span class="name">List</span></h3>
<p>Typedef for QList&lt;<a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a>&gt;.</p>
<!-- @@@List -->
<!-- $$$NodeKind$$$Attribute$$$Comment$$$Document$$$Element$$$Namespace$$$ProcessingInstruction$$$Text -->
<h3 class="fn" id="NodeKind-enum"><a name="NodeKind-enum"></a>enum QXmlNodeModelIndex::<span class="name">NodeKind</span></h3>
<p>Identifies a kind of node.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Attribute</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Identifies an attribute node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Text</code></td><td class="topAlign tblval"><code>64</code></td><td class="topAlign">Identifies a text node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Comment</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Identifies a comment node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Document</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Identifies a document node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Element</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">Identifies an element node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::Namespace</code></td><td class="topAlign tblval"><code>16</code></td><td class="topAlign">Identifies a namespace node</td></tr>
<tr><td class="topAlign"><code>QXmlNodeModelIndex::ProcessingInstruction</code></td><td class="topAlign tblval"><code>32</code></td><td class="topAlign">Identifies a processing instruction.</td></tr>
</table></div>
<p>Note that the optional XML declaration at very beginning of the XML document is not a processing instruction</p>
<p><b>See also </b><a href="qabstractxmlnodemodel.html#kind">QAbstractXmlNodeModel::kind</a>().</p>
<!-- @@@NodeKind -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QXmlNodeModelIndex[overload1]$$$QXmlNodeModelIndex -->
<h3 class="fn" id="QXmlNodeModelIndex"><a name="QXmlNodeModelIndex"></a>QXmlNodeModelIndex::<span class="name">QXmlNodeModelIndex</span>()</h3>
<p>Default constructor. Creates an item that is <code>null</code>.</p>
<p><b>See also </b><a href="qxmlnodemodelindex.html#isNull">isNull</a>().</p>
<!-- @@@QXmlNodeModelIndex -->
<!-- $$$QXmlNodeModelIndex$$$QXmlNodeModelIndexconstQXmlNodeModelIndex& -->
<h3 class="fn" id="QXmlNodeModelIndex-1"><a name="QXmlNodeModelIndex-1"></a>QXmlNodeModelIndex::<span class="name">QXmlNodeModelIndex</span>(const <span class="type"><a href="qxmlnodemodelindex.html#QXmlNodeModelIndex">QXmlNodeModelIndex</a></span> &amp;<i>other</i>)</h3>
<p>Standard copy constructor. Creates a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> instance that is a copy of <i>other</i>.</p>
<!-- @@@QXmlNodeModelIndex -->
<!-- $$$additionalData[overload1]$$$additionalData -->
<h3 class="fn" id="additionalData"><a name="additionalData"></a><span class="type">qint64</span> QXmlNodeModelIndex::<span class="name">additionalData</span>() const</h3>
<p>Returns the second data value. The node index holds two data values. <a href="qxmlnodemodelindex.html#data">data</a>() returns the first one.</p>
<p><b>See also </b><a href="qxmlnodemodelindex.html#data">data</a>().</p>
<!-- @@@additionalData -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn" id="data"><a name="data"></a><span class="type">qint64</span> QXmlNodeModelIndex::<span class="name">data</span>() const</h3>
<p>Returns the first data value. The node index holds two data values. <a href="qxmlnodemodelindex.html#additionalData">additionalData</a>() returns the second one.</p>
<p><b>See also </b><a href="qxmlnodemodelindex.html#additionalData">additionalData</a>().</p>
<!-- @@@data -->
<!-- $$$internalPointer[overload1]$$$internalPointer -->
<h3 class="fn" id="internalPointer"><a name="internalPointer"></a><span class="type">void</span> *QXmlNodeModelIndex::<span class="name">internalPointer</span>() const</h3>
<p>Returns the first data value as a void* pointer.</p>
<p><b>See also </b><a href="qxmlnodemodelindex.html#additionalData">additionalData</a>().</p>
<!-- @@@internalPointer -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn" id="isNull"><a name="isNull"></a><span class="type">bool</span> QXmlNodeModelIndex::<span class="name">isNull</span>() const</h3>
<p>Returns true if this <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> is a default constructed value, otherwise false.</p>
<p>A null <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> doesn't represent any node and cannot be used in conjunction with <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<!-- @@@isNull -->
<!-- $$$model[overload1]$$$model -->
<h3 class="fn" id="model"><a name="model"></a>const <span class="type"><a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a></span> *QXmlNodeModelIndex::<span class="name">model</span>() const</h3>
<p>Returns the <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> that this node index refers to. <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> does not own <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> and does not keep track of its lifetime, so this pointer will dangle if the <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> is deallocated first.</p>
<p>There is no setter for the node model because instances of <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> instances are only created with <a href="qabstractxmlnodemodel.html#createIndex">QAbstractXmlNodeModel::createIndex</a>().</p>
<!-- @@@model -->
<!-- $$$operator!=[overload1]$$$operator!=constQXmlNodeModelIndex& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QXmlNodeModelIndex::<span class="name">operator!=</span>(const <span class="type"><a href="qxmlnodemodelindex.html#QXmlNodeModelIndex">QXmlNodeModelIndex</a></span> &amp;<i>other</i>) const</h3>
<p>Returns true if <i>other</i> is the same node as this.</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQXmlNodeModelIndex& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QXmlNodeModelIndex::<span class="name">operator==</span>(const <span class="type"><a href="qxmlnodemodelindex.html#QXmlNodeModelIndex">QXmlNodeModelIndex</a></span> &amp;<i>other</i>) const</h3>
<p>Returns true if this node is the same as <i>other</i>. This operator does not compare values, children, or names of nodes. It compares node identities, i.e&#x2e;, whether two nodes are from the same document and are found at the exact same place.</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 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>