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

PathView item incorrectly positioned under certain circumstances

    XMLWordPrintable

Details

    • 1416e6bd3ec4aaefe33bb64c9ad64d251f7f2885

    Description

      Taken from: https://www.mail-archive.com/interest@qt-project.org/msg12290.html

      import QtQuick 2.2
      
      Rectangle {
           width: 220
           height: 220
           color: "#494d53"
      
           PathView {
               id: view
               width: 100
               height: delegateHeight * pathItemCount
               model: ["A", "B", "C"]
               pathItemCount: 3
               anchors.centerIn: parent
      
               Rectangle {
                   anchors.fill: parent
                   color: "transparent"
                   border.color: "darkorange"
               }
      
               property int delegateHeight: 0
      
               activeFocusOnTab: true
               Keys.onDownPressed: view.incrementCurrentIndex()
               Keys.onUpPressed: view.decrementCurrentIndex()
               preferredHighlightBegin: 0.5
               preferredHighlightEnd: 0.5
      
               delegate: Rectangle {
                   width: view.width
                   height: textItem.height
                   border.color: "red"
      
                   onHeightChanged: if (index == 0) view.delegateHeight = 
      textItem.height
      
                   Text {
                       id: textItem
                       text: modelData
                   }
               }
      
               path: Path {
                   startX: view.width / 2
                   startY: 0
                   PathLine {
                       x: view.width / 2
                       y: view.pathItemCount * view.delegateHeight
                   }
               }
           }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-40298
        # Subject Branch Project Status CR V

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes