Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ScrollView in ListView delegate: can't scroll in Qt6 build

ScrollView in ListView delegate: can't scroll in Qt6 build

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlscrollviewlistview
1 Posts 1 Posters 400 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RickS
    wrote on 20 Jun 2022, 11:15 last edited by
    #1

    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.

    1 Reply Last reply
    0

    1/1

    20 Jun 2022, 11:15

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved