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

ListView's contentY isn't updated when the delegateHeight starts off at 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.11.0
    • None

    Description

      import QtQuick 2.0
      import QtQuick.Window 2.0
      
      Window {
          id: window
          width: 800
          height: 400
          visible: true
          title: "currentIndex: " + listView.currentIndex
           + " contentY: " + listView.contentY
      
          property real delegateHeight: 0
      
          ListView {
              id: listView
              width: 800
              height: 400
      //        width: parent.width
      //        height: parent.height
              currentIndex: 50
              model: 100
              delegate: Text {
                  id: delegateText
                  text: modelData
                  width: ListView.view.width
                  height: delegateHeight
                  font.bold: ListView.isCurrentItem
                  horizontalAlignment: Text.AlignHCenter
                  verticalAlignment: Text.AlignVCenter
              }
          }
      
          Timer {
              running: true
              interval: 0
              onTriggered: delegateHeight = 133
          }
      }
      

      Attachments

        Issue Links

          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
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes