/usr/share/qt5/doc/qtquick/qml-qtquick-flickable.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 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 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickflickable.cpp -->
<title>Flickable QML Type | Qt Quick 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="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-qmlmodule.html">QML Types</a></td><td >Flickable QML Type</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="#properties">Properties</a></li>
<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>
<li class="level2"><a href="#example-usage">Example Usage</a></li>
<li class="level2"><a href="#limitations">Limitations</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Flickable QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Flickable-brief -->
<p>Provides a surface that can be "flicked" <a href="#details">More...</a></p>
<!-- @@@Flickable -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.7</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-item.html">Item</a></p>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-gridview.html">GridView</a> and <a href="qml-qtquick-listview.html">ListView</a></p>
</td></tr></table></div><ul>
<li><a href="qml-qtquick-flickable-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#atXBeginning-prop">atXBeginning</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#atXEnd-prop">atXEnd</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#atYBeginning-prop">atYBeginning</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#atYEnd-prop">atYEnd</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#bottomMargin-prop">bottomMargin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#boundsBehavior-prop">boundsBehavior</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#contentItem-prop">contentItem</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#contentX-prop">contentX</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#contentY-prop">contentY</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#dragging-prop">dragging</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#draggingHorizontally-prop">draggingHorizontally</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#draggingVertically-prop">draggingVertically</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickDeceleration-prop">flickDeceleration</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickableDirection-prop">flickableDirection</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flicking-prop">flicking</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickingHorizontally-prop">flickingHorizontally</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickingVertically-prop">flickingVertically</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#horizontalOvershoot-prop">horizontalOvershoot</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#horizontalVelocity-prop">horizontalVelocity</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#interactive-prop">interactive</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#leftMargin-prop">leftMargin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#maximumFlickVelocity-prop">maximumFlickVelocity</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#moving-prop">moving</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#movingHorizontally-prop">movingHorizontally</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#movingVertically-prop">movingVertically</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#originX-prop">originX</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#originY-prop">originY</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#pixelAligned-prop">pixelAligned</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#pressDelay-prop">pressDelay</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#rebound-prop">rebound</a></b></b> : Transition</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#rightMargin-prop">rightMargin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#topMargin-prop">topMargin</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#verticalOvershoot-prop">verticalOvershoot</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#verticalVelocity-prop">verticalVelocity</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#visibleArea-prop">visibleArea</a></b></b><ul>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#visibleArea.xPosition-prop">visibleArea.xPosition</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#visibleArea.widthRatio-prop">visibleArea.widthRatio</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#visibleArea.yPosition-prop">visibleArea.yPosition</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#visibleArea.heightRatio-prop">visibleArea.heightRatio</a></b></b> : real</li>
</ul>
</li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickEnded-signal">flickEnded</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flickStarted-signal">flickStarted</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#movementEnded-signal">movementEnded</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#movementStarted-signal">movementStarted</a></b></b>()</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#cancelFlick-method">cancelFlick</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#flick-method">flick</a></b></b>(qreal <i>xVelocity</i>, qreal <i>yVelocity</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#resizeContent-method">resizeContent</a></b></b>(real <i>width</i>, real <i>height</i>, QPointF <i>center</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-flickable.html#returnToBounds-method">returnToBounds</a></b></b>()</li>
</ul>
<!-- $$$Flickable-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>The Flickable item places its children on a surface that can be dragged and flicked, causing the view onto the child items to scroll. This behavior forms the basis of Items that are designed to show large numbers of child items, such as <a href="qml-qtquick-listview.html">ListView</a> and <a href="qml-qtquick-gridview.html">GridView</a>.</p>
<p>In traditional user interfaces, views can be scrolled using standard controls, such as scroll bars and arrow buttons. In some situations, it is also possible to drag the view directly by pressing and holding a mouse button while moving the cursor. In touch-based user interfaces, this dragging action is often complemented with a flicking action, where scrolling continues after the user has stopped touching the view.</p>
<p>Flickable does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the <a href="qml-qtquick-item.html#clip-prop">clip</a> property to true.</p>
<a name="example-usage"></a>
<h2 id="example-usage">Example Usage</h2>
<div class="float-right"><p><img src="images/flickable.gif" alt="" /></p>
</div><p>The following example shows a small view onto a large image in which the user can drag or flick the image in order to view different parts of it.</p>
<pre class="qml">
import QtQuick 2.0
<span class="type"><a href="qml-qtquick-flickable.html">Flickable</a></span> {
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="name">contentWidth</span>: <span class="name">image</span>.<span class="name">width</span>; <span class="name">contentHeight</span>: <span class="name">image</span>.<span class="name">height</span>
<span class="type"><a href="qml-qtquick-image.html">Image</a></span> { <span class="name">id</span>: <span class="name">image</span>; <span class="name">source</span>: <span class="string">"bigImage.png"</span> }
}
</pre>
<br style="clear: both" /><p>Items declared as children of a Flickable are automatically parented to the Flickable's <a href="qml-qtquick-flickable.html#contentItem-prop">contentItem</a>. This should be taken into account when operating on the children of the Flickable; it is usually the children of <code>contentItem</code> that are relevant. For example, the bound of Items added to the Flickable will be available by <code>contentItem.childrenRect</code></p>
<a name="limitations"></a>
<h2 id="limitations">Limitations</h2>
<p><b>Note: </b>Due to an implementation detail, items placed inside a Flickable cannot anchor to the Flickable. Instead, use <a href="qml-qtquick-item.html#parent-prop">parent</a>, which refers to the Flickable's <a href="qml-qtquick-flickable.html#contentItem-prop">contentItem</a>. The size of the content item is determined by <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p><!-- @@@Flickable -->
<h2>Property Documentation</h2>
<!-- $$$atXBeginning -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="atXBeginning-prop">
<td class="tblQmlPropNode"><p>
<a name="atXBeginning-prop"></a><span class="name">atXBeginning</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties are true if the flickable view is positioned at the beginning, or end respectively.</p>
</div></div><!-- @@@atXBeginning -->
<br/>
<!-- $$$atXEnd -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="atXEnd-prop">
<td class="tblQmlPropNode"><p>
<a name="atXEnd-prop"></a><span class="name">atXEnd</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties are true if the flickable view is positioned at the beginning, or end respectively.</p>
</div></div><!-- @@@atXEnd -->
<br/>
<!-- $$$atYBeginning -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="atYBeginning-prop">
<td class="tblQmlPropNode"><p>
<a name="atYBeginning-prop"></a><span class="name">atYBeginning</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties are true if the flickable view is positioned at the beginning, or end respectively.</p>
</div></div><!-- @@@atYBeginning -->
<br/>
<!-- $$$atYEnd -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="atYEnd-prop">
<td class="tblQmlPropNode"><p>
<a name="atYEnd-prop"></a><span class="name">atYEnd</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties are true if the flickable view is positioned at the beginning, or end respectively.</p>
</div></div><!-- @@@atYEnd -->
<br/>
<!-- $$$bottomMargin -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="bottomMargin-prop">
<td class="tblQmlPropNode"><p>
<a name="bottomMargin-prop"></a><span class="name">bottomMargin</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the margins around the content. This space is reserved in addition to the <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p>
</div></div><!-- @@@bottomMargin -->
<br/>
<!-- $$$boundsBehavior -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="boundsBehavior-prop">
<td class="tblQmlPropNode"><p>
<a name="boundsBehavior-prop"></a><span class="name">boundsBehavior</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.</p>
<p>This enables the feeling that the edges of the view are soft, rather than a hard physical boundary.</p>
<p>The <code>boundsBehavior</code> can be one of:</p>
<ul>
<li>Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot.</li>
<li>Flickable.DragOverBounds - the contents can be dragged beyond the boundary of the Flickable, but flicks will not overshoot.</li>
<li>Flickable.OvershootBounds - the contents can overshoot the boundary when flicked, but the content cannot be dragged beyond the boundary of the flickable. (since <code>QtQuick 2.5</code>)</li>
<li>Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.</li>
</ul>
<p><b>See also </b><a href="qml-qtquick-flickable.html#horizontalOvershoot-prop">horizontalOvershoot</a> and <a href="qml-qtquick-flickable.html#verticalOvershoot-prop">verticalOvershoot</a>.</p>
</div></div><!-- @@@boundsBehavior -->
<br/>
<!-- $$$contentHeight -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentHeight-prop">
<td class="tblQmlPropNode"><p>
<a name="contentHeight-prop"></a><span class="name">contentHeight</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The dimensions of the content (the surface controlled by Flickable). This should typically be set to the combined size of the items placed in the Flickable.</p>
<p>The following snippet shows how these properties are used to display an image that is larger than the Flickable item itself:</p>
<pre class="qml">
import QtQuick 2.0
<span class="type"><a href="qml-qtquick-flickable.html">Flickable</a></span> {
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="name">contentWidth</span>: <span class="name">image</span>.<span class="name">width</span>; <span class="name">contentHeight</span>: <span class="name">image</span>.<span class="name">height</span>
<span class="type"><a href="qml-qtquick-image.html">Image</a></span> { <span class="name">id</span>: <span class="name">image</span>; <span class="name">source</span>: <span class="string">"bigImage.png"</span> }
}
</pre>
<p>In some cases, the content dimensions can be automatically set based on the <a href="qml-qtquick-item.html#childrenRect.width-prop">childrenRect.width</a> and <a href="qml-qtquick-item.html#childrenRect.height-prop">childrenRect.height</a> properties of the <a href="qml-qtquick-flickable.html#contentItem-prop">contentItem</a>. For example, the previous snippet could be rewritten with:</p>
<pre class="cpp">
contentWidth: contentItem<span class="operator">.</span>childrenRect<span class="operator">.</span>width; contentHeight: contentItem<span class="operator">.</span>childrenRect<span class="operator">.</span>height
</pre>
<p>Though this assumes that the origin of the childrenRect is 0,0.</p>
</div></div><!-- @@@contentHeight -->
<br/>
<!-- $$$contentItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentItem-prop">
<td class="tblQmlPropNode"><p>
<a name="contentItem-prop"></a><span class="name">contentItem</span> : <span class="type"><a href="qml-qtquick-item.html">Item</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The internal item that contains the Items to be moved in the Flickable.</p>
<p>Items declared as children of a Flickable are automatically parented to the Flickable's contentItem.</p>
<p>Items created dynamically need to be explicitly parented to the <i>contentItem</i>:</p>
<pre class="cpp">
Flickable {
id: myFlickable
function addItem(file) {
var component <span class="operator">=</span> <span class="type">Qt</span><span class="operator">.</span>createComponent(file)
component<span class="operator">.</span>createObject(myFlickable<span class="operator">.</span>contentItem);
}
}
</pre>
</div></div><!-- @@@contentItem -->
<br/>
<!-- $$$contentWidth -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentWidth-prop">
<td class="tblQmlPropNode"><p>
<a name="contentWidth-prop"></a><span class="name">contentWidth</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The dimensions of the content (the surface controlled by Flickable). This should typically be set to the combined size of the items placed in the Flickable.</p>
<p>The following snippet shows how these properties are used to display an image that is larger than the Flickable item itself:</p>
<pre class="qml">
import QtQuick 2.0
<span class="type"><a href="qml-qtquick-flickable.html">Flickable</a></span> {
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="name">contentWidth</span>: <span class="name">image</span>.<span class="name">width</span>; <span class="name">contentHeight</span>: <span class="name">image</span>.<span class="name">height</span>
<span class="type"><a href="qml-qtquick-image.html">Image</a></span> { <span class="name">id</span>: <span class="name">image</span>; <span class="name">source</span>: <span class="string">"bigImage.png"</span> }
}
</pre>
<p>In some cases, the content dimensions can be automatically set based on the <a href="qml-qtquick-item.html#childrenRect.width-prop">childrenRect.width</a> and <a href="qml-qtquick-item.html#childrenRect.height-prop">childrenRect.height</a> properties of the <a href="qml-qtquick-flickable.html#contentItem-prop">contentItem</a>. For example, the previous snippet could be rewritten with:</p>
<pre class="cpp">
contentWidth: contentItem<span class="operator">.</span>childrenRect<span class="operator">.</span>width; contentHeight: contentItem<span class="operator">.</span>childrenRect<span class="operator">.</span>height
</pre>
<p>Though this assumes that the origin of the childrenRect is 0,0.</p>
</div></div><!-- @@@contentWidth -->
<br/>
<!-- $$$contentX -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentX-prop">
<td class="tblQmlPropNode"><p>
<a name="contentX-prop"></a><span class="name">contentX</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the surface coordinate currently at the top-left corner of the Flickable. For example, if you flick an image up 100 pixels, <code>contentY</code> will increase by 100.</p>
<p><b>Note: </b>If you flick back to the origin (the top-left corner), after the rebound animation, <code>contentX</code> will settle to the same value as <code>originX</code>, and <code>contentY</code> to <code>originY</code>. These are usually (0,0), however <a href="qml-qtquick-listview.html">ListView</a> and <a href="qml-qtquick-gridview.html">GridView</a> may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region. So if you want to implement something like a vertical scrollbar, one way is to use <code>y: (contentY - originY) * (height / contentHeight)</code> for the position; another way is to use the normalized values in <a href="qml-qtquick-flickable.html#visibleArea-prop">visibleArea</a>.</p><p><b>See also </b><a href="qml-qtquick-flickable.html#originX-prop">originX</a> and <a href="qml-qtquick-flickable.html#originY-prop">originY</a>.</p>
</div></div><!-- @@@contentX -->
<br/>
<!-- $$$contentY -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentY-prop">
<td class="tblQmlPropNode"><p>
<a name="contentY-prop"></a><span class="name">contentY</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the surface coordinate currently at the top-left corner of the Flickable. For example, if you flick an image up 100 pixels, <code>contentY</code> will increase by 100.</p>
<p><b>Note: </b>If you flick back to the origin (the top-left corner), after the rebound animation, <code>contentX</code> will settle to the same value as <code>originX</code>, and <code>contentY</code> to <code>originY</code>. These are usually (0,0), however <a href="qml-qtquick-listview.html">ListView</a> and <a href="qml-qtquick-gridview.html">GridView</a> may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region. So if you want to implement something like a vertical scrollbar, one way is to use <code>y: (contentY - originY) * (height / contentHeight)</code> for the position; another way is to use the normalized values in <a href="qml-qtquick-flickable.html#visibleArea-prop">visibleArea</a>.</p><p><b>See also </b><a href="qml-qtquick-flickable.html#originX-prop">originX</a> and <a href="qml-qtquick-flickable.html#originY-prop">originY</a>.</p>
</div></div><!-- @@@contentY -->
<br/>
<!-- $$$dragging -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="dragging-prop">
<td class="tblQmlPropNode"><p>
<a name="dragging-prop"></a><span class="name">dragging</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user dragging the view.</p>
</div></div><!-- @@@dragging -->
<br/>
<!-- $$$draggingHorizontally -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="draggingHorizontally-prop">
<td class="tblQmlPropNode"><p>
<a name="draggingHorizontally-prop"></a><span class="name">draggingHorizontally</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user dragging the view.</p>
</div></div><!-- @@@draggingHorizontally -->
<br/>
<!-- $$$draggingVertically -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="draggingVertically-prop">
<td class="tblQmlPropNode"><p>
<a name="draggingVertically-prop"></a><span class="name">draggingVertically</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user dragging the view.</p>
</div></div><!-- @@@draggingVertically -->
<br/>
<!-- $$$flickDeceleration -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickDeceleration-prop">
<td class="tblQmlPropNode"><p>
<a name="flickDeceleration-prop"></a><span class="name">flickDeceleration</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the rate at which a flick will decelerate.</p>
<p>The default value is platform dependent.</p>
</div></div><!-- @@@flickDeceleration -->
<br/>
<!-- $$$flickableDirection -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickableDirection-prop">
<td class="tblQmlPropNode"><p>
<a name="flickableDirection-prop"></a><span class="name">flickableDirection</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property determines which directions the view can be flicked.</p>
<ul>
<li>Flickable.AutoFlickDirection (default) - allows flicking vertically if the <i>contentHeight</i> is not equal to the <i>height</i> of the Flickable. Allows flicking horizontally if the <i>contentWidth</i> is not equal to the <i>width</i> of the Flickable.</li>
<li>Flickable.AutoFlickIfNeeded - allows flicking vertically if the <i>contentHeight</i> is greater than the <i>height</i> of the Flickable. Allows flicking horizontally if the <i>contentWidth</i> is greater than to the <i>width</i> of the Flickable. (since <code>QtQuick 2.7</code>)</li>
<li>Flickable.HorizontalFlick - allows flicking horizontally.</li>
<li>Flickable.VerticalFlick - allows flicking vertically.</li>
<li>Flickable.HorizontalAndVerticalFlick - allows flicking in both directions.</li>
</ul>
</div></div><!-- @@@flickableDirection -->
<br/>
<!-- $$$flicking -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flicking-prop">
<td class="tblQmlPropNode"><p>
<a name="flicking-prop"></a><span class="name">flicking</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user flicking the view.</p>
</div></div><!-- @@@flicking -->
<br/>
<!-- $$$flickingHorizontally -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickingHorizontally-prop">
<td class="tblQmlPropNode"><p>
<a name="flickingHorizontally-prop"></a><span class="name">flickingHorizontally</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user flicking the view.</p>
</div></div><!-- @@@flickingHorizontally -->
<br/>
<!-- $$$flickingVertically -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickingVertically-prop">
<td class="tblQmlPropNode"><p>
<a name="flickingVertically-prop"></a><span class="name">flickingVertically</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user flicking the view.</p>
</div></div><!-- @@@flickingVertically -->
<br/>
<!-- $$$horizontalOvershoot -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="horizontalOvershoot-prop">
<td class="tblQmlPropNode"><p>
<a name="horizontalOvershoot-prop"></a><span class="name">horizontalOvershoot</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the horizontal overshoot, that is, the horizontal distance by which the contents has been dragged or flicked past the bounds of the flickable. The value is negative when the content is dragged or flicked beyond the beginning, and positive when beyond the end; <code>0.0</code> otherwise.</p>
<p>This QML property was introduced in Qt 5.9.</p>
<p><b>See also </b><a href="qml-qtquick-flickable.html#verticalOvershoot-prop">verticalOvershoot</a> and <a href="qml-qtquick-flickable.html#boundsBehavior-prop">boundsBehavior</a>.</p>
</div></div><!-- @@@horizontalOvershoot -->
<br/>
<!-- $$$horizontalVelocity -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="horizontalVelocity-prop">
<td class="tblQmlPropNode"><p>
<a name="horizontalVelocity-prop"></a><span class="name">horizontalVelocity</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The instantaneous velocity of movement along the x and y axes, in pixels/sec.</p>
<p>The reported velocity is smoothed to avoid erratic output.</p>
<p>Note that for views with a large content size (more than 10 times the view size), the velocity of the flick may exceed the velocity of the touch in the case of multiple quick consecutive flicks. This allows the user to flick faster through large content.</p>
</div></div><!-- @@@horizontalVelocity -->
<br/>
<!-- $$$interactive -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="interactive-prop">
<td class="tblQmlPropNode"><p>
<a name="interactive-prop"></a><span class="name">interactive</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property describes whether the user can interact with the Flickable. A user cannot drag or flick a Flickable that is not interactive.</p>
<p>By default, this property is true.</p>
<p>This property is useful for temporarily disabling flicking. This allows special interaction with Flickable's children; for example, you might want to freeze a flickable map while scrolling through a pop-up dialog that is a child of the Flickable.</p>
</div></div><!-- @@@interactive -->
<br/>
<!-- $$$leftMargin -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="leftMargin-prop">
<td class="tblQmlPropNode"><p>
<a name="leftMargin-prop"></a><span class="name">leftMargin</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the margins around the content. This space is reserved in addition to the <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p>
</div></div><!-- @@@leftMargin -->
<br/>
<!-- $$$maximumFlickVelocity -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="maximumFlickVelocity-prop">
<td class="tblQmlPropNode"><p>
<a name="maximumFlickVelocity-prop"></a><span class="name">maximumFlickVelocity</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the maximum velocity that the user can flick the view in pixels/second.</p>
<p>The default value is platform dependent.</p>
</div></div><!-- @@@maximumFlickVelocity -->
<br/>
<!-- $$$moving -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="moving-prop">
<td class="tblQmlPropNode"><p>
<a name="moving-prop"></a><span class="name">moving</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user either dragging or flicking the view.</p>
</div></div><!-- @@@moving -->
<br/>
<!-- $$$movingHorizontally -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="movingHorizontally-prop">
<td class="tblQmlPropNode"><p>
<a name="movingHorizontally-prop"></a><span class="name">movingHorizontally</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user either dragging or flicking the view.</p>
</div></div><!-- @@@movingHorizontally -->
<br/>
<!-- $$$movingVertically -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="movingVertically-prop">
<td class="tblQmlPropNode"><p>
<a name="movingVertically-prop"></a><span class="name">movingVertically</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user either dragging or flicking the view.</p>
</div></div><!-- @@@movingVertically -->
<br/>
<!-- $$$originX -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="originX-prop">
<td class="tblQmlPropNode"><p>
<a name="originX-prop"></a><span class="name">originX</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the origin of the content. This value always refers to the top-left position of the content regardless of layout direction.</p>
<p>This is usually (0,0), however <a href="qml-qtquick-listview.html">ListView</a> and <a href="qml-qtquick-gridview.html">GridView</a> may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region.</p>
<p><b>See also </b><a href="qml-qtquick-flickable.html#contentX-prop">contentX</a> and <a href="qml-qtquick-flickable.html#contentY-prop">contentY</a>.</p>
</div></div><!-- @@@originX -->
<br/>
<!-- $$$originY -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="originY-prop">
<td class="tblQmlPropNode"><p>
<a name="originY-prop"></a><span class="name">originY</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the origin of the content. This value always refers to the top-left position of the content regardless of layout direction.</p>
<p>This is usually (0,0), however <a href="qml-qtquick-listview.html">ListView</a> and <a href="qml-qtquick-gridview.html">GridView</a> may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region.</p>
<p><b>See also </b><a href="qml-qtquick-flickable.html#contentX-prop">contentX</a> and <a href="qml-qtquick-flickable.html#contentY-prop">contentY</a>.</p>
</div></div><!-- @@@originY -->
<br/>
<!-- $$$pixelAligned -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="pixelAligned-prop">
<td class="tblQmlPropNode"><p>
<a name="pixelAligned-prop"></a><span class="name">pixelAligned</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property sets the alignment of <a href="qml-qtquick-flickable.html#contentX-prop">contentX</a> and <a href="qml-qtquick-flickable.html#contentY-prop">contentY</a> to pixels (<code>true</code>) or subpixels (<code>false</code>).</p>
<p>Enable pixelAligned to optimize for still content or moving content with high constrast edges, such as one-pixel-wide lines, text or vector graphics. Disable pixelAligned when optimizing for animation quality.</p>
<p>The default is <code>false</code>.</p>
</div></div><!-- @@@pixelAligned -->
<br/>
<!-- $$$pressDelay -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="pressDelay-prop">
<td class="tblQmlPropNode"><p>
<a name="pressDelay-prop"></a><span class="name">pressDelay</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the time to delay (ms) delivering a press to children of the Flickable. This can be useful where reacting to a press before a flicking action has undesirable effects.</p>
<p>If the flickable is dragged/flicked before the delay times out the press event will not be delivered. If the button is released within the timeout, both the press and release will be delivered.</p>
<p>Note that for nested Flickables with pressDelay set, the pressDelay of outer Flickables is overridden by the innermost Flickable. If the drag exceeds the platform drag threshold, the press event will be delivered regardless of this property.</p>
<p><b>See also </b><a href="../qtgui/qstylehints.html">QStyleHints</a>.</p>
</div></div><!-- @@@pressDelay -->
<br/>
<!-- $$$rebound -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rebound-prop">
<td class="tblQmlPropNode"><p>
<a name="rebound-prop"></a><span class="name">rebound</span> : <span class="type"><a href="qml-qtquick-transition.html">Transition</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This holds the transition to be applied to the content view when it snaps back to the bounds of the flickable. The transition is triggered when the view is flicked or dragged past the edge of the content area, or when <a href="qml-qtquick-flickable.html#returnToBounds-method">returnToBounds()</a> is called.</p>
<pre class="qml">
import QtQuick 2.0
<span class="type"><a href="qml-qtquick-flickable.html">Flickable</a></span> {
<span class="name">width</span>: <span class="number">150</span>; <span class="name">height</span>: <span class="number">150</span>
<span class="name">contentWidth</span>: <span class="number">300</span>; <span class="name">contentHeight</span>: <span class="number">300</span>
<span class="name">rebound</span>: <span class="name">Transition</span> {
<span class="type"><a href="qml-qtquick-numberanimation.html">NumberAnimation</a></span> {
<span class="name">properties</span>: <span class="string">"x,y"</span>
<span class="name">duration</span>: <span class="number">1000</span>
<span class="name">easing</span>.type: <span class="name">Easing</span>.<span class="name">OutBounce</span>
}
}
<span class="type"><a href="qml-qtquick-rectangle.html">Rectangle</a></span> {
<span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">300</span>
<span class="name">gradient</span>: <span class="name">Gradient</span> {
<span class="type"><a href="qml-qtquick-gradientstop.html">GradientStop</a></span> { <span class="name">position</span>: <span class="number">0.0</span>; <span class="name">color</span>: <span class="string">"lightsteelblue"</span> }
<span class="type"><a href="qml-qtquick-gradientstop.html">GradientStop</a></span> { <span class="name">position</span>: <span class="number">1.0</span>; <span class="name">color</span>: <span class="string">"blue"</span> }
}
}
}
</pre>
<p>When the above view is flicked beyond its bounds, it will return to its bounds using the transition specified:</p>
<p class="centerAlign"><img src="images/flickable-rebound.gif" alt="" /></p><p>If this property is not set, a default animation is applied.</p>
</div></div><!-- @@@rebound -->
<br/>
<!-- $$$rightMargin -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rightMargin-prop">
<td class="tblQmlPropNode"><p>
<a name="rightMargin-prop"></a><span class="name">rightMargin</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the margins around the content. This space is reserved in addition to the <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p>
</div></div><!-- @@@rightMargin -->
<br/>
<!-- $$$topMargin -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="topMargin-prop">
<td class="tblQmlPropNode"><p>
<a name="topMargin-prop"></a><span class="name">topMargin</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties hold the margins around the content. This space is reserved in addition to the <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p>
</div></div><!-- @@@topMargin -->
<br/>
<!-- $$$verticalOvershoot -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="verticalOvershoot-prop">
<td class="tblQmlPropNode"><p>
<a name="verticalOvershoot-prop"></a><span class="name">verticalOvershoot</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the vertical overshoot, that is, the vertical distance by which the contents has been dragged or flicked past the bounds of the flickable. The value is negative when the content is dragged or flicked beyond the beginning, and positive when beyond the end; <code>0.0</code> otherwise.</p>
<p>This QML property was introduced in Qt 5.9.</p>
<p><b>See also </b><a href="qml-qtquick-flickable.html#horizontalOvershoot-prop">horizontalOvershoot</a> and <a href="qml-qtquick-flickable.html#boundsBehavior-prop">boundsBehavior</a>.</p>
</div></div><!-- @@@verticalOvershoot -->
<br/>
<!-- $$$verticalVelocity -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="verticalVelocity-prop">
<td class="tblQmlPropNode"><p>
<a name="verticalVelocity-prop"></a><span class="name">verticalVelocity</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The instantaneous velocity of movement along the x and y axes, in pixels/sec.</p>
<p>The reported velocity is smoothed to avoid erratic output.</p>
<p>Note that for views with a large content size (more than 10 times the view size), the velocity of the flick may exceed the velocity of the touch in the case of multiple quick consecutive flicks. This allows the user to flick faster through large content.</p>
</div></div><!-- @@@verticalVelocity -->
<br/>
<!-- $$$visibleArea -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="even" id="visibleArea-prop"><th class="centerAlign"><p><a name="visibleArea-prop"></a><b>visibleArea group</b></p></th></tr><tr valign="top" class="odd" id="visibleArea.xPosition-prop"><td class="tblQmlPropNode"><p><a name="visibleArea.xPosition-prop"></a><span class="name">visibleArea.xPosition</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="visibleArea.widthRatio-prop"><td class="tblQmlPropNode"><p><a name="visibleArea.widthRatio-prop"></a><span class="name">visibleArea.widthRatio</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="visibleArea.yPosition-prop"><td class="tblQmlPropNode"><p><a name="visibleArea.yPosition-prop"></a><span class="name">visibleArea.yPosition</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="visibleArea.heightRatio-prop"><td class="tblQmlPropNode"><p><a name="visibleArea.heightRatio-prop"></a><span class="name">visibleArea.heightRatio</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>These properties describe the position and size of the currently viewed area. The size is defined as the percentage of the full view currently visible, scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to 1.0 minus size ratio (end), i.e. <code>yPosition</code> is in the range 0.0 to 1.0-<code>heightRatio</code>. However, it is possible for the contents to be dragged outside of the normal range, resulting in the page positions also being outside the normal range.</p>
<p>These properties are typically used to draw a scrollbar. For example:</p>
<pre class="qml">
<span class="type"><a href="qml-qtquick-rectangle.html">Rectangle</a></span> {
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="type"><a href="qml-qtquick-flickable.html">Flickable</a></span> {
<span class="name">id</span>: <span class="name">flickable</span>
...
}
<span class="type"><a href="qml-qtquick-rectangle.html">Rectangle</a></span> {
<span class="name">id</span>: <span class="name">scrollbar</span>
<span class="name">anchors</span>.right: <span class="name">flickable</span>.<span class="name">right</span>
<span class="name">y</span>: <span class="name">flickable</span>.<span class="name">visibleArea</span>.<span class="name">yPosition</span> <span class="operator">*</span> <span class="name">flickable</span>.<span class="name">height</span>
<span class="name">width</span>: <span class="number">10</span>
<span class="name">height</span>: <span class="name">flickable</span>.<span class="name">visibleArea</span>.<span class="name">heightRatio</span> <span class="operator">*</span> <span class="name">flickable</span>.<span class="name">height</span>
<span class="name">color</span>: <span class="string">"black"</span>
}
}
</pre>
<p><b>See also </b><a href="qtquick-customitems-scrollbar-example.html">UI Components: Scrollbar Example</a>.</p>
</div></div><!-- @@@visibleArea -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$flickEnded -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickEnded-signal">
<td class="tblQmlFuncNode"><p>
<a name="flickEnded-signal"></a><span class="name">flickEnded</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when the view stops moving due to a flick.</p>
<p>The corresponding handler is <code>onFlickEnded</code>.</p>
</div></div><!-- @@@flickEnded -->
<br/>
<!-- $$$flickStarted -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flickStarted-signal">
<td class="tblQmlFuncNode"><p>
<a name="flickStarted-signal"></a><span class="name">flickStarted</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when the view is flicked. A flick starts from the point that the mouse or touch is released, while still in motion.</p>
<p>The corresponding handler is <code>onFlickStarted</code>.</p>
</div></div><!-- @@@flickStarted -->
<br/>
<!-- $$$movementEnded -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="movementEnded-signal">
<td class="tblQmlFuncNode"><p>
<a name="movementEnded-signal"></a><span class="name">movementEnded</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when the view stops moving due to user interaction or a generated <a href="qml-qtquick-flickable.html#flick-method">flick()</a>. If a flick was active, this signal will be emitted once the flick stops. If a flick was not active, this signal will be emitted when the user stops dragging - i.e. a mouse or touch release.</p>
<p>The corresponding handler is <code>onMovementEnded</code>.</p>
</div></div><!-- @@@movementEnded -->
<br/>
<!-- $$$movementStarted -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="movementStarted-signal">
<td class="tblQmlFuncNode"><p>
<a name="movementStarted-signal"></a><span class="name">movementStarted</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when the view begins moving due to user interaction or a generated <a href="qml-qtquick-flickable.html#flick-method">flick()</a>.</p>
<p>The corresponding handler is <code>onMovementStarted</code>.</p>
</div></div><!-- @@@movementStarted -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$cancelFlick -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="cancelFlick-method">
<td class="tblQmlFuncNode"><p>
<a name="cancelFlick-method"></a><span class="name">cancelFlick</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Cancels the current flick animation.</p>
</div></div><!-- @@@cancelFlick -->
<br/>
<!-- $$$flick -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="flick-method">
<td class="tblQmlFuncNode"><p>
<a name="flick-method"></a><span class="name">flick</span>(<span class="type">qreal</span> <i>xVelocity</i>, <span class="type">qreal</span> <i>yVelocity</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Flicks the content with <i>xVelocity</i> horizontally and <i>yVelocity</i> vertically in pixels/sec.</p>
<p>Calling this method will update the corresponding moving and flicking properties and signals, just like a real flick.</p>
</div></div><!-- @@@flick -->
<br/>
<!-- $$$resizeContent -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="resizeContent-method">
<td class="tblQmlFuncNode"><p>
<a name="resizeContent-method"></a><span class="name">resizeContent</span>(<span class="type">real</span> <i>width</i>, <span class="type">real</span> <i>height</i>, <span class="type">QPointF</span> <i>center</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Resizes the content to <i>width</i> x <i>height</i> about <i>center</i>.</p>
<p>This does not scale the contents of the Flickable - it only resizes the <a href="qml-qtquick-flickable.html#contentWidth-prop">contentWidth</a> and <a href="qml-qtquick-flickable.html#contentHeight-prop">contentHeight</a>.</p>
<p>Resizing the content may result in the content being positioned outside the bounds of the Flickable. Calling <a href="qml-qtquick-flickable.html#returnToBounds-method">returnToBounds()</a> will move the content back within legal bounds.</p>
</div></div><!-- @@@resizeContent -->
<br/>
<!-- $$$returnToBounds -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="returnToBounds-method">
<td class="tblQmlFuncNode"><p>
<a name="returnToBounds-method"></a><span class="name">returnToBounds</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Ensures the content is within legal bounds.</p>
<p>This may be called to ensure that the content is within legal bounds after manually positioning the content.</p>
</div></div><!-- @@@returnToBounds -->
<br/>
</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>
|