Important: Please read the Qt Code of Conduct -

QML ListView nesting GridView, the ScrollBar behavior is not natural

  • I have a requirement about show the Photo gallery group by datetime.
    I use a QML ListView nesting GridView,It looks like:
    It looks well unit I add a ScrollBar in ListView:

    Scrollbar.vertical : Scrollbar {
        hoverEnabled : true
        active : hovered ||pressed
        orientation : Qt . Vertical : parent . top
        anchors.right : parent . right
        anchors.bottom : parent , bottom
        contentItem : Rectangle {
            timplicitwidth : 6
            implicitheight : 100
            radius : width / 2
            color : "#0f1c3e"

    When I scroll in ListView The scorllbar changed it's size and position on changed the currentItem in ListView.

    I don't know why about it,but I found the contentHeight will change to the currentItem height after scroll the listView.
    I want get the actual behavior scroll bar,What need I do?

Log in to reply