Scrollbar
The ScrollBar component provides scrolling functionality for scrollable views (i.e. Flickable, ListView). More...
Inherits StyledItem
Properties
- align : int (preliminary)
- flickableItem : Flickable (preliminary)
- style : Component
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 style 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
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:
- Qt.AlignLeading anchors to the left on LTR and to the right on RTL layouts
- Qt.AlignTrailing anchors to the right on LTR and to the left on RTL layouts
- Qt.AlignTop anchors to the top
- Qt.AlignBottom anchors to the bottom
The default value is Qt.AlignTrailing.
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.