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

Content Y jumps constantly if first delegate height == 0 and other delegates have height > 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 5.0.0
    • None
    • At qt/qtdeclarative:master 1b65161042108ee46ca42331dacc2b66b63c6b4e
    • 881091b5c0f1d2ead2b70e54f7ac2e4c17680b4e

    Description

      If the height of the first delegate in a ListView is 0, and all other delegates have a height of 20, the view's content y will constantly jump between zero and -20.

      For example, using the following code, press Return to trigger the flickering:

      import QtQuick 2.0
      
      ListView {
          property int delegateHeight: 20
          width: 240; height: 320
          model: ListModel {
              Component.onCompleted: {
                  for (var i = 0; i < 10; i++)
                      append({})
              }
          }
          delegate: Rectangle {
              width: 240; height: index == 0 ? delegateHeight : 20; color: "red"
              Text { text: index }
          }
      
          focus: true
          Keys.onReturnPressed: delegateHeight = 0
      
          Text { anchors.bottom: parent.bottom; text: parent.contentY }
      }
      

      The bug does not occur if there are more items than that which can fit into a single screen.

      Attachments

        Issue Links

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

          Activity

            People

              bealam Bea Lam (closed Nokia identity) (Inactive)
              bealam Bea Lam (closed Nokia identity) (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