ScrollView 允许拖动内容。这怎么能被禁用?

ScrollView allows dragging content. How can this be disabled?

可以使用鼠标或触摸手势拖动 QML ScrollView 的内容。 ListViews的内容也是如此,至少在我的例子中是这样。 当内容适合 ScrollView 并且没有显示滚动条时,甚至可以这样做。在这种情况下,释放鼠标按钮后,内容项将移回其原始位置。有什么方法可以禁用它吗?

您正在寻找 属性 boundsBehavior which ScrollView inherits from Flickable. Setting it to Flickable.StopAtBounds should do the trick. See also the property interactive.