diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-02 13:23:09 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-02 15:32:03 +0200 |
commit | 64c1fbe96c68b1286a70242ff4922be140128cb2 (patch) | |
tree | c95a2d68fc50319f04e6cbae4c471c524c66ba5f /src/quick/util/qquickstate_p.h | |
parent | dfd12d4079b339a140d4697c7ca92c5ea4233315 (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/qquickstate_p.h')
-rw-r--r-- | src/quick/util/qquickstate_p.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/quick/util/qquickstate_p.h b/src/quick/util/qquickstate_p.h index 79874ee78e..576ba9834c 100644 --- a/src/quick/util/qquickstate_p.h +++ b/src/quick/util/qquickstate_p.h @@ -152,7 +152,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickState : public QObject Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QQmlBinding *when READ when WRITE setWhen) + Q_PROPERTY(bool when READ when WRITE setWhen) Q_PROPERTY(QString extend READ extends WRITE setExtends) Q_PROPERTY(QQmlListProperty<QQuickStateOperation> changes READ changes) Q_CLASSINFO("DefaultProperty", "changes") @@ -166,11 +166,9 @@ public: void setName(const QString &); bool isNamed() const; - /*'when' is a QQmlBinding to limit state changes oscillation - due to the unpredictable order of evaluation of bound expressions*/ bool isWhenKnown() const; - QQmlBinding *when() const; - void setWhen(QQmlBinding *); + bool when() const; + void setWhen(bool); QString extends() const; void setExtends(const QString &); |