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

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

XMLWordPrintable

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

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

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

            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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes