Qt Reference Documentation

QML ScrollDecorator Element

Provides a visual indicator for a Flickable component to show the size relationship between the visible and complete contents. More...

This element was introduced in Qt Quick Components 1.0f.

Properties

Detailed Description

When the size of a Flickable component is larger than the size of its container, it is often helpful to have some indication of where you are. For example, if you are navigating a long list, the scroll decorator will indicate how far down the list you have scrolled. The ScrollDecorator provides a simple way of adding this kind of indicator to a Flickable component.

The scroll decorator is often a scroll bar, but the actual implementation, including the location and behaviour of the scroll decorator, is platform dependent. Also, the scroll decorator is generally only visible when the list is being scrolled. Otherwise it is hidden from view.

ScrollDecorators can be used with Flickable components as well as Flickable- derived components, such as ListView and GridView.

Using a Scroll Decorator

A ScrollDecorator needs to be a sibling of the Flickable item that it is to be attached to. It will be implicitly anchored to that flickable so there is no need to do any further connecting yourself. The following code snippet gives an example of a scroll decorator attached to a list. In the Symbian implementation, the scroll decorator is a scrollbar and is only shown when the list is scrolling. See the image below for an example (the scroll bar is on the right).

 // define the list
 ListView {
     id: listView
     anchors.fill: parent
     focus: true
     clip: true
     model: listModel
     delegate: listDelegate
 }

 // add a scroll decorator for the list
 ScrollDecorator {
     id: scrolldecorator
     flickableItem: listView
 }

Property Documentation

flickableItem : Flickable

The Flickable component that the scroll decorator is attached to.


platformInverted : bool

Symbian:

If platformInverted is true, the component is visualized with the inverted style. For more information, see Using Inverted Style with Symbian Components. By default platformInverted is false.

This property group was introduced in Qt Quick Components 1.1.