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

QML: PathView: item positioning in the y axis appears to suffer from rounding error when moving rectangles along a horizontal path, causing the items to wobble up and down as they are flicked or moved

    XMLWordPrintable

Details

    • 8b66982ec7b4b5d2071931c288973dce73dc9875

    Description

      The following example reproduces the problem. In top pathview, when flicked/dragged, it can be observed that the items wobble up and down along the path in the y direction. This happens when the size of the item is odd.

      import QtQuick 1.0
      
      Item {
              width: 1100
              height: 700
              ListModel{
                  id: myModel
      
              }
      
              Component{
                  id: myDelegate
                  Rectangle{
                      height: 199
                      width: 199
                      color: "red"
                  }
              }
      
              PathView {
                      id: view1
      
                      height: 230
                      anchors.left: parent.left
                      anchors.right: parent.right
                      anchors.top: parent.top
                      highlightRangeMode: PathView.StrictlyEnforceRange
                      model: 5
      
                      delegate: myDelegate
      
                      path: Path {
                              startX: 0.0
                              startY: 100.0
      
                              PathLine { x: 1000.0; y: 100.0 }
      
                      }
              }
              PathView {
                      id: view2
      
                      height: 230
                      anchors.left: parent.left
                      anchors.right: parent.right
                      anchors.top: view1.bottom
      
                      model: 5
                      delegate: Rectangle {
                              height: 199
                              width: 199
                              color: "black"
                      }
      
                      path: Path {
                              startX: 0
                              startY: 100
                              PathLine { x: 1000; y: 100.000000001 /*workaround by adding a fractional part*/ }
                      }
              }
              PathView {
                      id: view3
      
                      height: 230
                      anchors.left: parent.left
                      anchors.right: parent.right
                      anchors.top: view2.bottom
      
                      model: 5
                      delegate: Rectangle {
                              height: 200 /*workaround by making sizes round to base 10*/
                              width: 200
                              color: "black"
                      }
      
                      path: Path {
                              startX: 0
                              startY: 100
                              PathLine { x: 1000; y: 100 }
                      }
              }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              dajansen Damian Jansen (closed Nokia identity) (Inactive)
              cattell Matthew Cattell (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes