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

[Reg 6.6.1 → 6.6.2] ListView footer item cannot be vertically placed

    XMLWordPrintable

Details

    • All
    • 27b404106 (dev), 12d025ca7 (6.7)

    Description

      The example code below shows a horizontal list and a footer item (green rectangle). The footer is vertically centered in Qt 6.6.1. With 6.6.2 it is the vertical position is unchanged (i.e. y = 0).

      Same behaviour when using anchoring to the verticalCenter (commented line), so works fine on 6.6.1 and not at all on 6.6.2. It even outputs an error in the latter:

      qrc:/sandbox/Main.qml:31:21: QML Rectangle: Possible anchor loop detected on vertical anchor.
      

      However, it is unclear why it should loop.

      We could observer this behaviour with Linux desktop and webassembly builds, so it is likely to happen on all platforms.

      import QtQuick
      import QtQuick.Window
      
      Window {
          id: win
          width: 640
          height: 480
          visible: true
          title: 'sandbox'
      
          Item {
              anchors.fill: parent
      
              Rectangle {
                  anchors.fill: list
                  border.width: 1
                  border.color: 'blue'
              }
      
              ListView {
                  id: list
                  height: 60
                  spacing: 20
                  orientation: ListView.Horizontal
                  anchors {
                      left: parent.left
                      right: parent.right
                      verticalCenter: parent.verticalCenter
                  }
      
                  footer: Rectangle {
                      // anchors.verticalCenter: parent?.verticalCenter
                      y: 15
                      color: 'lime'
                      width: 30
                      height: 30
                  }
      
                  model: 3
                  delegate: Text {
                      text: 'Foobar'
                      verticalAlignment: Text.AlignVCenter
                      anchors {
                          top: parent?.top
                          bottom: parent?.bottom
                      }
                  }
              }
          }
      }
      

      Attachments

        1. 6.6.1.png
          6.6.1.png
          3 kB
        2. 6.6.2.png
          6.6.2.png
          3 kB
        3. GridView.qml
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hurlevent Oliver Eftevaag
            moerkb Markus Bader
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes