Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15, 6.2, 6.3.0 Beta2, 6.3, 6.4.0 Beta1
-
5.14.2
-
a8c729d839 (qt/qtdeclarative/dev) cb4594718a (qt/qtdeclarative/6.3) cb4594718a (qt/tqtc-qtdeclarative/6.3) a8c729d839 (qt/tqtc-qtdeclarative/dev) c2b6f09d28 (qt/qtdeclarative/6.2) c2b6f09d28 (qt/tqtc-qtdeclarative/6.2) c2b6f09d28 (qt/qtdeclarative/6.2.4)
Description
The following example shows a state group with two defined states, with one when-binding each. It seems well-defined and behaves correctly in Qt 5.12.6, but not in Qt 5.14.2. The issue is that the state string visits the empty string "" in a transition between two well defined states.
Notice how root.number is 2, and is set to 1 with a timer. The state group defines states for when number is 1 and 2.
import QtQuick 2.11 Item { id: root property int number: 2 Timer { interval: 500 running: true repeat: false onTriggered: { root.number = 1 } } Item { id: item onStateChanged: console.log("state changed to", state); states: [ State { name: "n1" when: root.number === 1 }, State { name: "n2" when: root.number === 2 } ] } }
# With Qt 5.12.6: qml: state changed to n2 qml: state changed to n1
# With Qt 5.14.2: qml: state changed to n2 qml: state changed to qml: state changed to n1
Notice the empty state "". This state change naturally breaks transition animations.
We find this commit suspicious but cannot see what the possible fix is:
commit 64c1fbe96c68b1286a70242ff4922be140128cb2 Author: Fabian Kosmale <fabian.kosmale@qt.io> Date: Tue Jul 2 13:23:09 2019 +0200 use boolean for when property
Headsup hhvaal.
Attachments
Issue Links
- is duplicated by
-
QTBUG-91186 [REG 5.12.9->5.14.2] Using the when property of the State QML Type leads to the default state being applied between state changes.
- Reported
-
QTBUG-87383 [REG] Quick Item.state behavior changed from 5.14
- Closed
- relates to
-
QTBUG-84914 ListView crash during incubation of delegate with State using when
- Closed
- mentioned in
-
Page Loading...