aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickstategroup.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-07-02 13:23:09 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2019-07-02 15:32:03 +0200
commit64c1fbe96c68b1286a70242ff4922be140128cb2 (patch)
treec95a2d68fc50319f04e6cbae4c471c524c66ba5f /src/quick/util/qquickstategroup.cpp
parentdfd12d4079b339a140d4697c7ca92c5ea4233315 (diff)
use boolean for when property
QQuickState used to store "when" as a QQmlBinding to reduce state oscillation. It is unclear whether this is still an issue, but it breaks if a user sets "when" to a primitive value like "true" or "1". Fixes: QTBUG-76838 Change-Id: If400e5b1283687838ed252be2dfa52067f44564e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/util/qquickstategroup.cpp')
-rw-r--r--src/quick/util/qquickstategroup.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp
index b53949d21c..0adae82dcc 100644
--- a/src/quick/util/qquickstategroup.cpp
+++ b/src/quick/util/qquickstategroup.cpp
@@ -348,10 +348,9 @@ bool QQuickStateGroupPrivate::updateAutoState()
QQuickState *state = states.at(ii);
if (state->isWhenKnown()) {
if (state->isNamed()) {
- if (state->when() && state->when()->evaluate().toBool()) {
+ if (state->when()) {
if (stateChangeDebug())
- qWarning() << "Setting auto state due to:"
- << state->when()->expression();
+ qWarning() << "Setting auto state due to expression";
if (currentState != state->name()) {
q->setState(state->name());
return true;