ScrollablePage QML Type
ScrollablePage is a Page that holds scrollable content, such as a ListView. More...
Properties
- horizontalScrollBarInteractive : bool
- horizontalScrollBarPolicy : int
- keyboardNavigationEnabled : bool
- refreshing : bool
- supportsRefreshing : bool
- verticalScrollBarInteractive : bool
- verticalScrollBarPolicy : int
Detailed Description
Scrolling and scrolling indicators will be automatically managed.
Example usage:
ScrollablePage { id: root // The page will automatically be scrollable Rectangle { width: root.width height: 99999 } }
Warning: Do not put a ScrollView inside of a ScrollablePage; children of a ScrollablePage are already inside a ScrollView.
Another behavior added by this class is a "scroll down to refresh" behavior It also can give the contents of the flickable to have more top margins in order to make possible to scroll down the list to reach it with the thumb while using the phone with a single hand.
Implementations should handle the refresh themselves as follows
Example usage:
Kirigami.ScrollablePage { id: view supportsRefreshing: true onRefreshingChanged: { if (refreshing) { myModel.refresh(); } } ListView { // NOTE: MyModel doesn't come from the components, // it's purely an example on how it can be used together // some application logic that can update the list model // and signals when it's done. model: MyModel { onRefreshDone: view.refreshing = false; } delegate: ItemDelegate {} } } [...]
TODO qdoc inherits wrong page
Property Documentation
horizontalScrollBarInteractive : bool |
Set if the horizontal scrollbar should be interactable.
horizontalScrollBarPolicy : int |
This property sets the horizontal scrollbar policy.
Possible values:
Constant | Description |
---|---|
QQC2.ScrollBar.AsNeeded | The scroll bar is only shown when the content is too large to fit. |
QQC2.ScrollBar.AlwaysOff | The scroll bar is never shown. |
QQC2.ScrollBar.AlwaysOn | The scroll bar is always shown. |
The default value is ScrollBar.AlwaysOff
See also Qt::ScrollBarPolicy.
keyboardNavigationEnabled : bool |
This property sets whether it is possible to navigate the items in a view that support it.
If true, and if flickable is an item view (e.g. ListView, GridView), it will be possible to navigate the view current items with keyboard up/down arrow buttons. Also, any key event will be forwarded to the current list item.
default: true
refreshing : bool |
This property tells whether the list is asking for a refresh.
This property will automatically be set to true when the user pulls the list down enough, which in return, shows a loading spinner. When this is set to true, it signals the application logic to start its refresh procedure.
default: false
Note: The application itself will have to set back this property to false when done.
supportsRefreshing : bool |
This property sets whether scrollable page supports "pull down to refresh" behaviour.
default: false
verticalScrollBarInteractive : bool |
Set if the vertical scrollbar should be interactable.
verticalScrollBarPolicy : int |
This property sets the vertical scrollbar policy.
Possible values:
Constant | Description |
---|---|
QQC2.ScrollBar.AsNeeded | The scroll bar is only shown when the content is too large to fit. |
QQC2.ScrollBar.AlwaysOff | The scroll bar is never shown. |
QQC2.ScrollBar.AlwaysOn | The scroll bar is always shown. |
See also Qt::ScrollBarPolicy.