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. Horizontal ListView flickable bug when currentItem has different heights (Working QML code to reproduce the bug)

Horizontal ListView flickable bug when currentItem has different heights (Working QML code to reproduce the bug)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 139 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.
  • M Offline
    M Offline
    myuen
    wrote on last edited by
    #1

    I believe this is a bug and not an error on my part. But I'd like to get the community's input.

    With the below QML, I have 2 rectangles of different heights in a horizontal ListView. I can swipe back and forth between them. But as soon as I set LayoutMirroring.enabled to true, the swipes between stuttering. It halts half way between the two items, and I have to give it an extra swipe to complete the transition.

    import QtQuick 2.11
    import QtQuick.Window 2.11
    import QtQml.Models 2.8

    Window {
    visible: true
    width: 640
    height: 300
    title: qsTr("h World")

    ListView {
        id: lv
        //LayoutMirroring.enabled: true
        orientation: ListView.Horizontal
        width: 640
        height: currentItem.height
        spacing: 5
        snapMode: ListView.SnapOneItem
        highlightRangeMode:  ListView.StrictlyEnforceRange
    
        model: ObjectModel{
            Rectangle {
                width: 640
                height: 100
                color: "pink"
            }
            Rectangle {
                width: 640
                height: 300
                color: "blue"
            }
        }
    }
    

    }

    1 Reply Last reply
    0

    • Login

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