Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104052

Horizontal ListView fails to snap when LayoutMirroring enabled and currentItem.heights are variable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11, 5.14.2
    • None
    • Linux ubuntu installation
    • Linux/Wayland, Windows

    Description

      The below qml code allows you to swipe between two rectangles that are in a horizontal ListView. The two rectangles are different in height.

      However, as soon as I enable LayoutMirroring, the swiping between the rectangles becomes buggy. Instead of snapping from one rectangle to the other, it always stops in between the two rectangles. I must give it an extra swipe for it to complete the snap.

      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"
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            my3baos Mercy Yuen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes