Qt 4.8
Flickable Class Reference

The Flickable item provides a surface that can be "flicked". More...

Inheritance diagram for Flickable:
Item GridView ListView

Detailed Description

The Flickable item provides a surface that can be "flicked".

Since
4.7

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 ListView and GridView .

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.

Flickable does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the Item::clip property to true.

Example Usage

{class="float-right"}

flickable.gif

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.

import QtQuick 1.0
Flickable {
width: 200; height: 200
contentWidth: image.width; contentHeight: image.height
Image { id: image; source: "bigImage.png" }
}

Items declared as children of a Flickable are automatically parented to the Flickable's contentItem . This should be taken into account when operating on the children of the Flickable; it is usually the children of contentItem that are relevant. For example, the bound of Items added to the Flickable will be available by contentItem.childrenRect

Limitations

Note
Due to an implementation detail, items placed inside a Flickable cannot anchor to it by id. Use parent instead.

The documentation for this class was generated from the following file: