ScrollablePage

Search for usage in LXR

ScrollablePage Class Reference

Inherits org::kde::kirigami::Page.

Properties

Flickable flickable
 
int horizontalScrollBarPolicy
 
bool keyboardNavigationEnabled
 
QtObject mainItem
 
bool refreshing
 
alias scrollablePageChildren
 
alias scrollablePageData
 
bool supportsRefreshing
 
int verticalScrollBarPolicy
 

Detailed Description

ScrollablePage is a Page that holds scrollable content, such as a ListView.

Scrolling and scrolling indicators will be automatically managed.

Example usage:

id: root
// The page will automatically be scrollable
Rectangle {
width: root.width
height: 99999
}
}
ScrollablePage is a Page that holds scrollable content, such as a ListView.
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
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 {}
}
}
[...]
bool refreshing
This property tells whether the list is asking for a refresh.
bool supportsRefreshing
This property sets whether scrollable page supports "pull down to refresh" behaviour.

Definition at line 62 of file ScrollablePage.qml.

Property Documentation

◆ flickable

Flickable ScrollablePage::flickable
read

This property holds the main Flickable item of this page.

Deprecated
here for compatibility; will be removed in KF6.

Definition at line 87 of file ScrollablePage.qml.

◆ horizontalScrollBarPolicy

Qt::ScrollBarPolicy ScrollablePage::horizontalScrollBarPolicy
read

This property sets the horizontal scrollbar policy.

Definition at line 101 of file ScrollablePage.qml.

◆ keyboardNavigationEnabled

bool ScrollablePage::keyboardNavigationEnabled
read

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

Definition at line 123 of file ScrollablePage.qml.

◆ mainItem

QtObject ScrollablePage::mainItem
read

Definition at line 110 of file ScrollablePage.qml.

◆ refreshing

bool ScrollablePage::refreshing
read

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.

Definition at line 76 of file ScrollablePage.qml.

◆ scrollablePageChildren

alias ScrollablePage::scrollablePageChildren
read

Definition at line 106 of file ScrollablePage.qml.

◆ scrollablePageData

alias ScrollablePage::scrollablePageData
read
Remarks
This is the default property

Definition at line 104 of file ScrollablePage.qml.

◆ supportsRefreshing

bool ScrollablePage::supportsRefreshing
read

This property sets whether scrollable page supports "pull down to refresh" behaviour.

default: false

Definition at line 82 of file ScrollablePage.qml.

◆ verticalScrollBarPolicy

Qt::ScrollBarPolicy ScrollablePage::verticalScrollBarPolicy
read

This property sets the vertical scrollbar policy.

Definition at line 96 of file ScrollablePage.qml.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:49:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.