ScrollView in ListView delegate: can't scroll in Qt6 build
-
I have a ScrollView into a ListView delegate. The ScrollView is supposed to include a long text that can be vertically scrolled.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Scroll Test") ListView { anchors.fill: parent model: 5 delegate: Rectangle { id: rectDelegateId border.color: "blue" width: parent.width height: parent.height/5 Rectangle { id: scrollRect width: rectDelegateId.width/2 height: parent.height border.color: "black" color: "lightblue" ScrollView { clip: true anchors.fill: parent Text { text: "A1\nA2\nA3\nA4\nA5\nA6\nA7\nA8\nA9\nA10\nA11\nA12" width: scrollRect.width } } } } } }
The issue happens when I run the application in a tablet with a touchscreen.
In Qt5 (tested with 5.15.2), I can scroll the text ScrollView by dragging the finger over the text.
In Qt6 (tested with 6.2.4), I cannot scroll the text ScrollView by dragging the finger over the text. Only if I connect a mouse I can scroll it or interact with the scrollbars. Using the fingers I can only scroll the whole listview. The scrollbar up/down buttons also have no effect if I tap them.
I'm not sure if this has to do with the following quote from the manual:
Note: As of Qt-6.0, ScrollView automatically clips its contents if you don't use a Flickable as a child. If this is not wanted, you can set your own Flickable as a child, and control the clip property on the Flickable explicitly.
But I don't know how to fix it.