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

Spacing for invisible ListView delegate not removed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.13.1
    • None
    • Windows

    Description

      When a delegate in a ListView has its visible property set to false, the spacing for it should collapse as though the element does not exist. Instead a jarring blank space is left where the delegate would have been had it been visible in addition to spacing before and after the blank space.

      Example:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      import QtQuick.Window 2.12
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          ListView {
              anchors.fill: parent
              model: ListModel {
                  ListElement {
                      name: "hi"
                  }
                  ListElement {
                      name: "bye"
                  }
                  ListElement {
                      name: "sad"
                  }
                  ListElement {
                      name: "stay"
                  }
                  ListElement {
                      name: "why"
                  }
              }
      
              delegate: Label {
                  text: name
                  visible: name !== "sad"
              }
          }
      }
      

      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
              dchamberlain David Chamberlain
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes