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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
|
<?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" />
<!-- qdeclarativepathview.cpp -->
<title>Qt 4.8: QML PathView 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>Qt 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="qdeclarativeelements.html">QML Elements</a></li>
<li>QML PathView 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="#properties">Attached Properties</a></li>
<li class="level1"><a href="#signal-handlers">Signal Handlers</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML PathView Element</h1>
<span class="subtitle"></span>
<!-- $$$PathView-brief -->
<p>The PathView element lays out model-provided items on a path. <a href="#details">More...</a></p>
<!-- @@@PathView -->
<p>Inherits <a href="qml-item.html">Item</a></p>
<p>This element was introduced in Qt 4.7.</p>
<ul>
<li><a href="qml-pathview-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-pathview.html#count-prop">count</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-pathview.html#currentIndex-prop">currentIndex</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-pathview.html#delegate-prop">delegate</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-pathview.html#dragMargin-prop">dragMargin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-pathview.html#flickDeceleration-prop">flickDeceleration</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-pathview.html#flicking-prop">flicking</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-pathview.html#highlight-prop">highlight</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-pathview.html#highlightItem-prop">highlightItem</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-pathview.html#highlightMoveDuration-prop">highlightMoveDuration</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-pathview.html#interactive-prop">interactive</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-pathview.html#model-prop">model</a></b></b> : model</li>
<li class="fn"><b><b><a href="qml-pathview.html#moving-prop">moving</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-pathview.html#offset-prop">offset</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-pathview.html#path-prop">path</a></b></b> : Path</li>
<li class="fn"><b><b><a href="qml-pathview.html#pathItemCount-prop">pathItemCount</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-pathview.html#preferredHighlightBegin-prop">preferredHighlightBegin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-pathview.html#preferredHighlightEnd-prop">preferredHighlightEnd</a></b></b> : real</li>
</ul>
<a name="attached-properties"></a>
<h2>Attached Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-pathview.html#isCurrentItem-prop">isCurrentItem</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-pathview.html#onPath-prop">onPath</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-pathview.html#view-prop">view</a></b></b> : PathView</li>
</ul>
<a name="signal-handlers"></a>
<h2>Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-pathview.html#onFlickEnded-signal">onFlickEnded</a></b></b></li>
<li class="fn"><b><b><a href="qml-pathview.html#onFlickStarted-signal">onFlickStarted</a></b></b></li>
<li class="fn"><b><b><a href="qml-pathview.html#onMovementEnded-signal">onMovementEnded</a></b></b></li>
<li class="fn"><b><b><a href="qml-pathview.html#onMovementStarted-signal">onMovementStarted</a></b></b></li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-pathview.html#decrementCurrentIndex-method">decrementCurrentIndex</a></b></b></li>
<li class="fn"><b><b><a href="qml-pathview.html#incrementCurrentIndex-method">incrementCurrentIndex</a></b></b></li>
</ul>
<!-- $$$PathView-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>A PathView displays data from models created from built-in QML elements like <a href="qml-listmodel.html">ListModel</a> and <a href="qml-xmllistmodel.html">XmlListModel</a>, or custom model classes defined in C++ that inherit from <a href="qabstractlistmodel.html">QAbstractListModel</a>.</p>
<p>The view has a <a href="qml-pathview.html#model-prop">model</a>, which defines the data to be displayed, and a <a href="qml-pathview.html#delegate-prop">delegate</a>, which defines how the data should be displayed. The <a href="qml-pathview.html#delegate-prop">delegate</a> is instantiated for each item on the <a href="qml-pathview.html#path-prop">path</a>. The items may be flicked to move them along the path.</p>
<p>For example, if there is a simple list model defined in a file <tt>ContactModel.qml</tt> like this:</p>
<pre class="qml"> import QtQuick 1.0
<span class="type"><a href="qml-listmodel.html">ListModel</a></span> {
<span class="type"><a href="qml-listelement.html">ListElement</a></span> {
<span class="name">name</span>: <span class="string">"Bill Jones"</span>
<span class="name">icon</span>: <span class="string">"pics/qtlogo.png"</span>
}
<span class="type"><a href="qml-listelement.html">ListElement</a></span> {
<span class="name">name</span>: <span class="string">"Jane Doe"</span>
<span class="name">icon</span>: <span class="string">"pics/qtlogo.png"</span>
}
<span class="type"><a href="qml-listelement.html">ListElement</a></span> {
<span class="name">name</span>: <span class="string">"John Smith"</span>
<span class="name">icon</span>: <span class="string">"pics/qtlogo.png"</span>
}
}</pre>
<p>This data can be represented as a PathView, like this:</p>
<pre class="qml"> import QtQuick 1.0
<span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
<span class="name">width</span>: <span class="number">240</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="type"><a href="qml-component.html">Component</a></span> {
<span class="name">id</span>: <span class="name">delegate</span>
<span class="type"><a href="qml-column.html">Column</a></span> {
<span class="name">id</span>: <span class="name">wrapper</span>
<span class="type"><a href="qml-image.html">Image</a></span> {
<span class="name">anchors</span>.horizontalCenter: <span class="name">nameText</span>.<span class="name">horizontalCenter</span>
<span class="name">width</span>: <span class="number">64</span>; <span class="name">height</span>: <span class="number">64</span>
<span class="name">source</span>: <span class="name">icon</span>
}
<span class="type"><a href="qml-text.html">Text</a></span> {
<span class="name">id</span>: <span class="name">nameText</span>
<span class="name">text</span>: <span class="name">name</span>
<span class="name">font</span>.pointSize: <span class="number">16</span>
<span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">PathView</span>.<span class="name">isCurrentItem</span> ? <span class="string">"red"</span> : <span class="string">"black"</span>
}
}
}
<span class="type">PathView</span> {
<span class="name">anchors</span>.fill: <span class="name">parent</span>
<span class="name">model</span>: <span class="name">ContactModel</span> {}
<span class="name">delegate</span>: <span class="name">delegate</span>
<span class="name">path</span>: <span class="name">Path</span> {
<span class="name">startX</span>: <span class="number">120</span>; <span class="name">startY</span>: <span class="number">100</span>
<span class="type"><a href="qml-pathquad.html">PathQuad</a></span> { <span class="name">x</span>: <span class="number">120</span>; <span class="name">y</span>: <span class="number">25</span>; <span class="name">controlX</span>: <span class="number">260</span>; <span class="name">controlY</span>: <span class="number">75</span> }
<span class="type"><a href="qml-pathquad.html">PathQuad</a></span> { <span class="name">x</span>: <span class="number">120</span>; <span class="name">y</span>: <span class="number">100</span>; <span class="name">controlX</span>: -<span class="number">20</span>; <span class="name">controlY</span>: <span class="number">75</span> }
}
}
}</pre>
<p class="centerAlign"><img src="images/pathview.gif" alt="" /></p><p>(Note the above example uses <a href="qml-pathattribute.html">PathAttribute</a> to scale and modify the opacity of the items as they rotate. This additional code can be seen in the <a href="qml-pathattribute.html">PathAttribute</a> documentation.)</p>
<p>PathView does not automatically handle keyboard navigation. This is because the keys to use for navigation will depend upon the shape of the path. Navigation can be added quite simply by setting <tt>focus</tt> to <tt>true</tt> and calling <a href="qml-pathview.html#decrementCurrentIndex-method">decrementCurrentIndex()</a> or <a href="qml-pathview.html#incrementCurrentIndex-method">incrementCurrentIndex()</a>, for example to navigate using the left and right arrow keys:</p>
<pre class="qml"> <span class="type">PathView</span> {
<span class="comment">// ...</span>
<span class="name">focus</span>: <span class="number">true</span>
<span class="name">Keys</span>.onLeftPressed: <span class="name">decrementCurrentIndex</span>()
<span class="name">Keys</span>.onRightPressed: <span class="name">incrementCurrentIndex</span>()
}</pre>
<p>The path view itself is a focus scope (see <a href="qdeclarativefocus.html#acquiring-focus-and-focus-scopes">the focus documentation page</a> for more details).</p>
<p>Delegates are instantiated as needed and may be destroyed at any time. State should <i>never</i> be stored in a delegate.</p>
<p>PathView attaches a number of properties to the root item of the delegate, for example <tt>PathView.isCurrentItem</tt>. In the following example, the root delegate item can access this attached property directly as <tt>PathView.isCurrentItem</tt>, while the child <tt>nameText</tt> object must refer to this property as <tt>wrapper.PathView.isCurrentItem</tt>.</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
<span class="name">id</span>: <span class="name">delegate</span>
<span class="type"><a href="qml-column.html">Column</a></span> {
<span class="name">id</span>: <span class="name">wrapper</span>
<span class="type"><a href="qml-image.html">Image</a></span> {
<span class="name">anchors</span>.horizontalCenter: <span class="name">nameText</span>.<span class="name">horizontalCenter</span>
<span class="name">width</span>: <span class="number">64</span>; <span class="name">height</span>: <span class="number">64</span>
<span class="name">source</span>: <span class="name">icon</span>
}
<span class="type"><a href="qml-text.html">Text</a></span> {
<span class="name">id</span>: <span class="name">nameText</span>
<span class="name">text</span>: <span class="name">name</span>
<span class="name">font</span>.pointSize: <span class="number">16</span>
<span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">PathView</span>.<span class="name">isCurrentItem</span> ? <span class="string">"red"</span> : <span class="string">"black"</span>
}
}
}</pre>
<p><b>Note</b> that views do not enable <i>clip</i> automatically. If the view is not clipped by another item or the screen, it will be necessary to set <i>clip: true</i> in order to have the out of view items clipped nicely.</p>
<p><b>See also </b><a href="qml-path.html">Path</a> and <a href="declarative-modelviews-pathview.html">PathView example</a>.</p>
<!-- @@@PathView -->
<h2>Property Documentation</h2>
<!-- $$$count -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="count-prop"></a><span class="qmlreadonly">read-only</span><span class="name">count</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the number of items in the model.</p>
</div></div><!-- @@@count -->
<br/>
<!-- $$$currentIndex -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the index of the current item.</p>
</div></div><!-- @@@currentIndex -->
<br/>
<!-- $$$delegate -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="delegate-prop"></a><span class="name">delegate</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>The delegate provides a template defining each item instantiated by the view. The index is exposed as an accessible <tt>index</tt> property. Properties of the model are also available depending upon the type of <a href="qdeclarativemodels.html#qmlmodels">Data Model</a>.</p>
<p>The number of elements in the delegate has a direct effect on the flicking performance of the view when <a href="qml-pathview.html#pathItemCount-prop">pathItemCount</a> is specified. If at all possible, place functionality that is not needed for the normal display of the delegate in a <a href="qml-loader.html">Loader</a> which can load additional elements when needed.</p>
<p>Note that the <a href="qml-pathview.html">PathView</a> will layout the items based on the size of the root item in the delegate.</p>
<p>Here is an example delegate:</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
<span class="name">id</span>: <span class="name">delegate</span>
<span class="type"><a href="qml-column.html">Column</a></span> {
<span class="name">id</span>: <span class="name">wrapper</span>
<span class="type"><a href="qml-image.html">Image</a></span> {
<span class="name">anchors</span>.horizontalCenter: <span class="name">nameText</span>.<span class="name">horizontalCenter</span>
<span class="name">width</span>: <span class="number">64</span>; <span class="name">height</span>: <span class="number">64</span>
<span class="name">source</span>: <span class="name">icon</span>
}
<span class="type"><a href="qml-text.html">Text</a></span> {
<span class="name">id</span>: <span class="name">nameText</span>
<span class="name">text</span>: <span class="name">name</span>
<span class="name">font</span>.pointSize: <span class="number">16</span>
<span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">PathView</span>.<span class="name">isCurrentItem</span> ? <span class="string">"red"</span> : <span class="string">"black"</span>
}
}
}</pre>
</div></div><!-- @@@delegate -->
<br/>
<!-- $$$dragMargin -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="dragMargin-prop"></a><span class="name">dragMargin</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the maximum distance from the path that initiate mouse dragging.</p>
<p>By default the path can only be dragged by clicking on an item. If dragMargin is greater than zero, a drag can be initiated by clicking within dragMargin pixels of the path.</p>
</div></div><!-- @@@dragMargin -->
<br/>
<!-- $$$flickDeceleration -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="flickDeceleration-prop"></a><span class="name">flickDeceleration</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the rate at which a flick will decelerate.</p>
<p>The default is 100.</p>
</div></div><!-- @@@flickDeceleration -->
<br/>
<!-- $$$flicking -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="flicking-prop"></a><span class="qmlreadonly">read-only</span><span class="name">flicking</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the view is currently moving due to the user flicking the view.</p>
</div></div><!-- @@@flicking -->
<br/>
<!-- $$$highlight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlight-prop"></a><span class="name">highlight</span> : <span class="type"><a href="qml-component.html">Component</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the component to use as the highlight.</p>
<p>An instance of the highlight component will be created for each view. The geometry of the resultant component instance will be managed by the view so as to stay with the current item.</p>
<p>The below example demonstrates how to make a simple highlight. Note the use of the <a href="qml-pathview.html#onPath-prop">PathView.onPath</a> attached property to ensure that the highlight is hidden when flicked away from the path.</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
<span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
<span class="name">visible</span>: <span class="name">PathView</span>.<span class="name">onPath</span>
<span class="comment">// ...</span>
}
}</pre>
<p><b>See also </b><a href="qml-pathview.html#highlightItem-prop">highlightItem</a> and <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a>.</p>
</div></div><!-- @@@highlight -->
<br/>
<!-- $$$highlightItem -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightItem-prop"></a><span class="qmlreadonly">read-only</span><span class="name">highlightItem</span> : <span class="type"><a href="qml-item.html">Item</a></span></p></td></tr></table></div><div class="qmldoc"><p><tt>highlightItem</tt> holds the highlight item, which was created from the <a href="qml-pathview.html#highlight-prop">highlight</a> component.</p>
<p><b>See also </b><a href="qml-pathview.html#highlight-prop">highlight</a>.</p>
</div></div><!-- @@@highlightItem -->
<br/>
<!-- $$$highlightMoveDuration -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightMoveDuration-prop"></a><span class="name">highlightMoveDuration</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the move animation duration of the highlight delegate.</p>
<p>If the <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a> is StrictlyEnforceRange then this property determines the speed that the items move along the path.</p>
<p>The default value for the duration is 300ms.</p>
</div></div><!-- @@@highlightMoveDuration -->
<br/>
<!-- $$$interactive -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="interactive-prop"></a><span class="name">interactive</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>A user cannot drag or flick a <a href="qml-pathview.html">PathView</a> that is not interactive.</p>
<p>This property is useful for temporarily disabling flicking. This allows special interaction with <a href="qml-pathview.html">PathView</a>'s children.</p>
</div></div><!-- @@@interactive -->
<br/>
<!-- $$$model -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="model-prop"></a><span class="name">model</span> : <span class="type">model</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the model providing data for the view.</p>
<p>The model provides a set of data that is used to create the items for the view. For large or dynamic datasets the model is usually provided by a C++ model object. Models can also be created directly in QML, using the <a href="qml-listmodel.html">ListModel</a> element.</p>
<p><b>See also </b><a href="qdeclarativemodels.html#qmlmodels">Data Models</a>.</p>
</div></div><!-- @@@model -->
<br/>
<!-- $$$moving -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="moving-prop"></a><span class="qmlreadonly">read-only</span><span class="name">moving</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the view is currently moving due to the user either dragging or flicking the view.</p>
</div></div><!-- @@@moving -->
<br/>
<!-- $$$offset -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="offset-prop"></a><span class="name">offset</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>The offset specifies how far along the path the items are from their initial positions. This is a real number that ranges from 0.0 to the count of items in the model.</p>
</div></div><!-- @@@offset -->
<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="qml-path.html">Path</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the path used to lay out the items. For more information see the <a href="qml-path.html">Path</a> documentation.</p>
</div></div><!-- @@@path -->
<br/>
<!-- $$$pathItemCount -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="pathItemCount-prop"></a><span class="name">pathItemCount</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the number of items visible on the path at any one time.</p>
</div></div><!-- @@@pathItemCount -->
<br/>
<!-- $$$preferredHighlightBegin -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="preferredHighlightBegin-prop"></a><span class="name">preferredHighlightBegin</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="preferredHighlightEnd-prop"></a><span class="name">preferredHighlightEnd</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="highlightRangeMode-prop"></a><span class="name">highlightRangeMode</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>These properties set the preferred range of the highlight (current item) within the view. The preferred values must be in the range 0.0-1.0.</p>
<p>If <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a> is set to <i>PathView.NoHighlightRange</i></p>
<p>If <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a> is set to <i>PathView.ApplyRange</i> the view will attempt to maintain the highlight within the range, however the highlight can move outside of the range at the ends of the path or due to a mouse interaction.</p>
<p>If <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a> is set to <i>PathView.StrictlyEnforceRange</i> the highlight will never move outside of the range. This means that the current item will change if a keyboard or mouse action would cause the highlight to move outside of the range.</p>
<p>Note that this is the correct way to influence where the current item ends up when the view moves. For example, if you want the currently selected item to be in the middle of the path, then set the highlight range to be 0.5,0.5 and <a href="qml-pathview.html#highlightRangeMode-prop">highlightRangeMode</a> to <a href="qml-pathview.html">PathView</a>.StrictlyEnforceRange. Then, when the path scrolls, the currently selected item will be the item at that position. This also applies to when the currently selected item changes - it will scroll to within the preferred highlight range. Furthermore, the behaviour of the current item index will occur whether or not a highlight exists.</p>
<p>The default value is <i>PathView.StrictlyEnforceRange</i>.</p>
<p>Note that a valid range requires <a href="qml-pathview.html#preferredHighlightEnd-prop">preferredHighlightEnd</a> to be greater than or equal to preferredHighlightBegin.</p>
</div></div><!-- @@@preferredHighlightBegin -->
<br/>
<h2>Attached Property Documentation</h2>
<!-- $$$isCurrentItem -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="isCurrentItem-prop"></a><span class="qmlreadonly">read-only</span><span class="name">PathView.isCurrentItem</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This attached property is true if this delegate is the current item; otherwise false.</p>
<p>It is attached to each instance of the delegate.</p>
<p>This property may be used to adjust the appearance of the current item.</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
<span class="name">id</span>: <span class="name">delegate</span>
<span class="type"><a href="qml-column.html">Column</a></span> {
<span class="name">id</span>: <span class="name">wrapper</span>
<span class="type"><a href="qml-image.html">Image</a></span> {
<span class="name">anchors</span>.horizontalCenter: <span class="name">nameText</span>.<span class="name">horizontalCenter</span>
<span class="name">width</span>: <span class="number">64</span>; <span class="name">height</span>: <span class="number">64</span>
<span class="name">source</span>: <span class="name">icon</span>
}
<span class="type"><a href="qml-text.html">Text</a></span> {
<span class="name">id</span>: <span class="name">nameText</span>
<span class="name">text</span>: <span class="name">name</span>
<span class="name">font</span>.pointSize: <span class="number">16</span>
<span class="name">color</span>: <span class="name">wrapper</span>.<span class="name">PathView</span>.<span class="name">isCurrentItem</span> ? <span class="string">"red"</span> : <span class="string">"black"</span>
}
}
}</pre>
</div></div><!-- @@@isCurrentItem -->
<br/>
<!-- $$$onPath -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="onPath-prop"></a><span class="qmlreadonly">read-only</span><span class="name">PathView.onPath</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This attached property holds whether the item is currently on the path.</p>
<p>If a <a href="qml-pathview.html#pathItemCount-prop">pathItemCount</a> has been set, it is possible that some items may be instantiated, but not considered to be currently on the path. Usually, these items would be set invisible, for example:</p>
<pre class="qml"> <span class="type"><a href="qml-component.html">Component</a></span> {
<span class="type"><a href="qml-rectangle.html">Rectangle</a></span> {
<span class="name">visible</span>: <span class="name">PathView</span>.<span class="name">onPath</span>
<span class="comment">// ...</span>
}
}</pre>
<p>It is attached to each instance of the delegate.</p>
</div></div><!-- @@@onPath -->
<br/>
<!-- $$$view -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="view-prop"></a><span class="qmlreadonly">read-only</span><span class="name">PathView.view</span> : <span class="type">PathView</span></p></td></tr></table></div><div class="qmldoc"><p>This attached property holds the view that manages this delegate instance.</p>
<p>It is attached to each instance of the delegate.</p>
</div></div><!-- @@@view -->
<br/>
<h2>Signal Handler Documentation</h2>
<!-- $$$onFlickEnded -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onFlickEnded-signal"></a>PathView::<span class="name">onFlickEnded</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the view stops moving due to a flick.</p>
</div></div><!-- @@@onFlickEnded -->
<br/>
<!-- $$$onFlickStarted -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onFlickStarted-signal"></a>PathView::<span class="name">onFlickStarted</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the view is flicked. A flick starts from the point that the mouse or touch is released, while still in motion.</p>
</div></div><!-- @@@onFlickStarted -->
<br/>
<!-- $$$onMovementEnded -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onMovementEnded-signal"></a>PathView::<span class="name">onMovementEnded</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the view stops moving due to user interaction. If a flick was generated, this handler will be triggered once the flick stops. If a flick was not generated, the handler will be triggered when the user stops dragging - i.e. a mouse or touch release.</p>
</div></div><!-- @@@onMovementEnded -->
<br/>
<!-- $$$onMovementStarted -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onMovementStarted-signal"></a>PathView::<span class="name">onMovementStarted</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the view begins moving due to user interaction.</p>
</div></div><!-- @@@onMovementStarted -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$decrementCurrentIndex -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="decrementCurrentIndex-method"></a>PathView::<span class="name">decrementCurrentIndex</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Decrements the current index.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@decrementCurrentIndex -->
<br/>
<!-- $$$incrementCurrentIndex -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="incrementCurrentIndex-method"></a>PathView::<span class="name">incrementCurrentIndex</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Increments the current index.</p>
<p><b>Note</b>: methods should only be called after the Component has completed.</p>
</div></div><!-- @@@incrementCurrentIndex -->
<br/>
<p class="naviNextPrevious footerNavi">
</p>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
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.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|