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

Open PathView doesn't by default end at 100%

    XMLWordPrintable

Details

    • d08fb44d8f1414bbf519875fd872d742c41300ec

    Description

      Run the code below and observe the correct layout.
      Then comment out the "PathPercent

      { value: 1 }

      " line at the end and run again.
      For some reason this yields a different result, which seems incorrect.

      import QtQuick 1.1
      
      Rectangle {
          width: 360
          height: 480
      
          PathView {
              anchors.fill: parent
              dragMargin: 1000
              preferredHighlightBegin: 0.028
              preferredHighlightEnd: 0.028
              highlightRangeMode: PathView.StrictlyEnforceRange
              model: 4
              interactive: false
              delegate: Rectangle {
                  color: "red"
                  width: 40
                  height: 40
                  Text {
                      anchors.centerIn: parent
                      text: index
                      color: parent.PathView.isCurrentItem ? "black" : "white"
                      font.pixelSize: 20
                  }
                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          while(parent.PathView.view.currentIndex != index) {
                              parent.PathView.view.incrementCurrentIndex();
                          }
                      }
                  }
              }
      
              path: Path {
                  startX: -20; startY: 100
                  PathLine { x: 360/2; y: 100 }
                  PathPercent { value: 0.1 }
                  PathLine { x: 360+20; y: 100 }
                  PathPercent { value: 1 }  // Why is this not implied?
              }
          }
      }
      

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes