我有两个Flickable在一个列中,我想滚动垂直第一次闪烁,当用户滚动第二次闪烁。
Rectangle {
id: root
anchors.fill: parent
Flickable {
id: first
anchors.left: parent.left
width: parent.width/2
height: parent.height
// Rest of the Contents
// I have also some TextFields and ComboBoxs here
}
Flickable {
id: second
anchors.left: first.right
width: parent.width/2
height: parent.height
onFlickEnded: {
first.contentY = second.contentY;
}
// Rest of the Contents
// I have also some TextFields and ComboBoxs here
}
}我可以使用onFlickEnded事件来做这件事,这是正确的方式吗?如何在用户点击拖拽时禁用轻弹效果,并使用鼠标滚轮才能有滚动效果?
我是否应该使用ScrollView,但我不能像使用Flickable那样滚动它。
发布于 2021-11-12 17:34:55
使用onFlickStarted,您可以立即对要禁用的flickable调用cancelFlick()。然后使用onContentYChanged处理它。
发布于 2020-06-02 20:30:55
将"interactive“设置为false应禁用轻弹。
你可以用"onContentYChanged“代替"onFlickEnded”。
https://stackoverflow.com/questions/62148503
复制相似问题