qml Flickable
时间: 2023-10-02 16:09:19 浏览: 127
QML Flickable is a QML element that allows users to scroll through content that is larger than the viewable area. It provides a way for users to interact with content by flicking it with their fingers to scroll through it.
Flickable is a child element that can contain any other QML element such as Text, Image, Rectangle, etc. The content inside a Flickable element is automatically wrapped in a contentItem element which can be accessed using the contentItem property.
Some of the important properties of Flickable are listed below:
- contentWidth/contentHeight: The size of the content inside the Flickable element.
- horizontal/verticalFlickEnabled: Specifies whether flicking is enabled in the horizontal/vertical direction.
- boundsBehavior: Specifies how the flickable element should behave when the user reaches the end of the content.
- contentX/contentY: The current position of the content inside the Flickable element.
Flickable also provides a number of signals that can be used to detect user interactions, such as onFlickStarted, onFlickEnded, onContentXChanged, and onContentYChanged.
Overall, Flickable is a very useful element for creating interactive user interfaces with QML.
阅读全文