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

ListView's Delegate has invalid spacing for huge elements number

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.4.2, 5.5.0
    • Quick: Controls 1
    • None
    • Windows 8.1 Pro (mingw492_32)

    Description

      Steps to occur problem in the example appplication:
      1. Scroll down.
      2. Spacing between delegates is irregular

      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Window 2.2
      
      ApplicationWindow {
          title: qsTr("Example 2")
          width: 640
          height: 480
          visible: true
      
          toolBar: Text {
              width: toolBar.width
              wrapMode: Text.WordWrap
              text: "Description: Scroll down. Spacing between delegates is invalid"
          }
      
          ScrollView {
              anchors { fill: parent }
              flickableItem.interactive: true
      
              ListView {
                  id: listView
      
                  anchors { fill: parent }
      
                  spacing: 10
      
                  model: 1000000
                  delegate: Rectangle {
                      width: listView.width
                      height: 90 //e.g. for 118 layouting work correctly (118 + 10(spacing) = 128) ?
                      border.color: "black"
                      color: "gray"
      
                      Text {
                          anchors.centerIn: parent
                          color: "black"
                          text: index
                      }
                  }
              }
          }
      }
      

      Attachments

        1. example2.png
          example2.png
          15 kB
        2. example2.zip
          2 kB

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              permotion88 Karol Polak
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes