Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.0.0, 5.4.0 Beta
-
None
Description
With the code below, press the space key to change orientation. Observe the yellow square is not re-positioned correctly. This is because the delegate item has already been created internally and the item's previous y (which was defined while in the vertical orientation) is used for the new orientation.
import QtQuick 2.0 Item { id: root property real panelSize: 150 width: 200; height: 200 ListView { width: 200; height: 200 model: VisualItemModel { Rectangle { width: root.panelSize; height: root.panelSize; color: "red" } Rectangle { width: root.panelSize; height: root.panelSize; color: "yellow" } Rectangle { width: root.panelSize; height: root.panelSize; color: "green" } } focus: true Keys.onSpacePressed: { orientation = Qt.Horizontal } } }