/usr/share/qt5/doc/qtqml/qmodelindex-and-related-classes-in-qml.html is in qtdeclarative5-doc-html 5.9.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qqmlitemmodels.qdoc -->
<title>QModelIndex and related Classes in QML | Qt QML 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="qtqml-index.html">Qt QML</a></td><td >QModelIndex and related Classes in QML</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.5 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="#qmodelindex-and-qpersistentmodelindex-types">QModelIndex and QPersistentModelIndex Types</a></li>
<li class="level1"><a href="#qmodelindexlist-type">QModelIndexList Type</a></li>
<li class="level1"><a href="#qitemselectionrange-type"><a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> Type</a></li>
<li class="level1"><a href="#qitemselection-type">QItemSelection Type</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QModelIndex and related Classes in QML</h1>
<span class="subtitle"></span>
<!-- $$$qmodelindex-and-related-classes-in-qml.html-description -->
<div class="descr"> <a name="details"></a>
<p>Since Qt 5.5, <a href="../qtcore/qmodelindex.html">QModelIndex</a> and <a href="../qtcore/qpersistentmodelindex.html">QPersistentModelIndex</a> are exposed in QML as value-based types. Also exposed in a similar fashion are <a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a>, <a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> and <a href="../qtcore/qitemselection.html">QItemSelection</a>. All objects from these types can be passed back and forth between QML and C++ as <code>var</code> properties or plain JavaScript variables.</p>
<p>Below you will find an overview of the API exposed to QML for these classes. For more information, refer to their C++ documentation.</p>
<p><b>Note: </b>Since all these types are exposed as <a href="../qtcore/qobject.html#Q_GADGET">gadgets</a>, there are no property change notification signals emitted. Therefore binding to their properties may not give the expected results. This is especially true for <a href="../qtcore/qpersistentmodelindex.html">QPersistentModelIndex</a>.</p><a name="qmodelindex-and-qpersistentmodelindex-types"></a>
<h2 id="qmodelindex-and-qpersistentmodelindex-types">QModelIndex and QPersistentModelIndex Types</h2>
<ul>
<li><b>row</b> : int</li>
<li><b>column</b> : int</li>
<li><b>parent</b> : <a href="../qtcore/qmodelindex.html">QModelIndex</a></li>
<li><b>valid</b> : bool</li>
<li><b>model</b> : <a href="../qtcore/qabstractitemmodel.html">QAbstractItemModel</a></li>
<li><b>internalId</b> : quint64</li>
</ul>
<p>All these properties are read-only, as are their C++ counterparts.</p>
<p><b>Note: </b>The usual caveats apply to <a href="../qtcore/qmodelindex.html">QModelIndex</a> in QML. If the underlying model changes or gets deleted, it may become dangerous to access its properties. Therefore, you should not store any <a href="../qtcore/qmodelindex.html">QModelIndex</a> objects. You can, however, store QPersistentModelIndexe objects in a safe way.</p><a name="qmodelindexlist-type"></a>
<h2 id="qmodelindexlist-type">QModelIndexList Type</h2>
<p><a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a> is exposed in QML as a JavaScript array. Conversions are automatically made from and to C++. In fact, any JavaScript array can be converted back to <a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a>, with non-<a href="../qtcore/qmodelindex.html">QModelIndex</a> objects replaced by invalid <a href="../qtcore/qmodelindex.html">QModelIndex</a>es.</p>
<p><b>Note: </b><a href="../qtcore/qmodelindex.html">QModelIndex</a> to <a href="../qtcore/qpersistentmodelindex.html">QPersistentModelIndex</a> conversion happens when accessing the array elements because any <a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a> property retains reference semantics when exposed this way.</p><a name="qitemselectionrange-type"></a>
<h2 id="qitemselectionrange-type"><a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> Type</h2>
<ul>
<li><b>top</b> : int</li>
<li><b>left</b> : int</li>
<li><b>bottom</b> : int</li>
<li><b>right</b> : int</li>
<li><b>width</b> : int</li>
<li><b>height</b> : int</li>
<li><b>topLeft</b> : <a href="../qtcore/qpersistentmodelindex.html">QPersistentModelIndex</a></li>
<li><b>bottomRight</b> : <a href="../qtcore/qpersistentmodelindex.html">QPersistentModelIndex</a></li>
<li><b>parent</b> : <a href="../qtcore/qmodelindex.html">QModelIndex</a></li>
<li><b>valid</b> : bool</li>
<li><b>empty</b> : bool</li>
<li><b>model</b> : <a href="../qtcore/qabstractitemmodel.html">QAbstractItemModel</a></li>
</ul>
<p>All these properties are read-only, as are their C++ counterparts. In addition, we also expose the following functions:</p>
<ul>
<li>bool <b>contains</b>(<a href="../qtcore/qmodelindex.html">QModelIndex</a> <i>index</i>)</li>
<li>bool <b>contains</b>(int <i>row</i>, int <i>column</i>, <a href="../qtcore/qmodelindex.html">QModelIndex</a> <i>parentIndex</i>)</li>
<li>bool <b>intersects</b>(<a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> <i>other</i>)</li>
<li><a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> <b>intersected</b>(<a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> <i>other</i>)</li>
</ul>
<a name="qitemselection-type"></a>
<h2 id="qitemselection-type">QItemSelection Type</h2>
<p>Similarly to <a href="../qtcore/qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a>, <a href="../qtcore/qitemselection.html">QItemSelection</a> is exposed in QML as a JavaScript array of <a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> objects. Conversions are automatically made from and to C++. In fact, any JavaScript array can be converted back to <a href="../qtcore/qitemselection.html">QItemSelection</a>, with non-<a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a> objects replaced by empty <a href="../qtcore/qitemselectionrange.html">QItemSelectionRange</a>s.</p>
</div>
<p><b>See also </b><a href="qml-qtqml-models-itemselectionmodel.html">ItemSelectionModel</a>.</p>
<!-- @@@qmodelindex-and-related-classes-in-qml.html -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</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>
|