【发布时间】:2020-06-02 09:05:52
【问题描述】:
我在一列中有两个Flickable,当用户滚动第二个 Flickable 时,我想垂直滚动第一个 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 那样滚动它。
【问题讨论】:
标签: qt qml qtquick2 qtquickcontrols2 flickable