What properties does LiveView set to prevent sliding out of the boundary?
-
Test QT5.12.3. version
Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work
import QtQuick.Window 2.2 import QtQuick.Controls 2.2 Window { visible: true width: 300 height: 450 title: qsTr("Hello World") ListView{ id:listView anchors.fill: parent model: 10 snapMode: ListView.SnapOneItem orientation:ListView.Horizontal clip:true boundsBehavior:ListView.DragAndOvershootBounds delegate: Rectangle{ width: listView.width height: listView.height color: index%2 ? "red":"yellow" Label{ anchors.centerIn: parent font.pointSize: 100 text: index } } } }
-
Test QT5.12.3. version
Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work
import QtQuick.Window 2.2 import QtQuick.Controls 2.2 Window { visible: true width: 300 height: 450 title: qsTr("Hello World") ListView{ id:listView anchors.fill: parent model: 10 snapMode: ListView.SnapOneItem orientation:ListView.Horizontal clip:true boundsBehavior:ListView.DragAndOvershootBounds delegate: Rectangle{ width: listView.width height: listView.height color: index%2 ? "red":"yellow" Label{ anchors.centerIn: parent font.pointSize: 100 text: index } } } }
Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work
Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.
It does what the documentation says.
I guess you need:Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot.
-
Using boundsBehavior:ListView.DragAndOvershootBounds doesn't work
Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.
It does what the documentation says.
I guess you need:Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot.
-
@GrecKo
Not found DragAndOvershootBounds in the following address.
How do I prevent LiveView from sliding out of the boundary?
https://doc.qt.io/archives/qt-4.8/qml-listview.html@mirro said in What properties does LiveView set to prevent sliding out of the boundary?:
Do you use Qt4?!
Above you wrote "Test QT5.12.3. version" - so why do you read Qt4 documentation? -
@mirro said in What properties does LiveView set to prevent sliding out of the boundary?:
Do you use Qt4?!
Above you wrote "Test QT5.12.3. version" - so why do you read Qt4 documentation? -
@jsulm
Not found DragAndOvershootBounds in the following address.
https://doc.qt.io/archives/qt-5.13/qml-qtquick-listview.htmlHow do I prevent LiveView from sliding out of the boundary?