Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.2, 6.7
-
None
-
-
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 } } } } }