Contents

Scrollbar

The ScrollBar component provides scrolling functionality for scrollable views (i.e. Flickable, ListView). More...

Properties

Detailed Description

The ScrollBar can be set to any flickable and has built-in anchoring setup to the attached flickable's front, rear, top or bottom. the scrollbar can also be aligned using anchors, however the built-in align functionality makes sure to have the proper alignemt applied based on theme and layout direction (RTL or LTR).

The content position is driven through the attached Flickable. Therefore every delegate implementation should drive the position through contentX/contentY properties, depending on whether the orientation is vertical or horizontal.

Example:

Item {
    ListView {
        id: list
        width: units.gu(37)
        height: units.gu(37)
        model: 30
        delegate: Rectangle {
            width: ListView.view.width
            height: units.gu(5)
            Text {
                anchors.fill: parent
                text: "Item " + modelData
            }
        }
    }
    Scrollbar {
        flickableItem: list
        align: Qt.AlignTrailing
    }
}

Property Documentation

align : int

This documentation is under development and is subject to change.

The property defines the alignment of the scrollbar to the flickableItem. The implementation handles the alignment as follows:

The default value is Qt.AlignTrailing.


flickableItem : Flickable

This documentation is under development and is subject to change.

This property holds the flickable item (Flickable, ListView or GridView) the Scrollbar is attached to.