diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2010-09-14 14:43:47 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2010-09-14 14:43:47 (GMT) |
commit | 6454f4db1697af1d36ad4c0ea83ccd0bb490fd39 (patch) | |
tree | c0971fdbf74a70d5d1c1a31b9dfcc4411bceb099 /src/declarative/util/qdeclarativestate_p.h | |
parent | 37b9c2df53b281bddee26291855e0c7f01f52a7c (diff) | |
download | Qt-6454f4db1697af1d36ad4c0ea83ccd0bb490fd39.zip Qt-6454f4db1697af1d36ad4c0ea83ccd0bb490fd39.tar.gz Qt-6454f4db1697af1d36ad4c0ea83ccd0bb490fd39.tar.bz2 |
This patch allows modifications on PropertyChanges on the fly
This is important for Bauhaus to ensure that we can
edit properties and states dynamically in the visual
editor
Most of the changes consist of added functions
for Bauhaus, that do not affect any current
behaviour.
Important changes:
QDeclarativeAbstractBinding is holding a
QSharedPointer to itself so that other classes
can hold a weak reference to avoid accessing
dangling pointers while keeping track of bindings.
QDeclarativeStateOperation now has its own private class
QDeclarativeStateOperationPrivate to hold a pointer back
to QDeclarativeState since the parent is not set correctly
in every context.
QDeclarativePropertyChangesPrivate does now hold a
QDeclarativeGuard instead of a raw pointer to the
target QObject. In Bauhaus the target object might
be deleted.
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/util/qdeclarativestate_p.h')
-rw-r--r-- | src/declarative/util/qdeclarativestate_p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h index 2e2ce7b..a0ab11b 100644 --- a/src/declarative/util/qdeclarativestate_p.h +++ b/src/declarative/util/qdeclarativestate_p.h @@ -111,6 +111,8 @@ public: //### rename to QDeclarativeStateChange? class QDeclarativeStateGroup; +class QDeclarativeState; +class QDeclarativeStateOperationPrivate; class Q_DECLARATIVE_EXPORT QDeclarativeStateOperation : public QObject { Q_OBJECT @@ -121,8 +123,15 @@ public: virtual ActionList actions(); + QDeclarativeState *state() const; + void setState(QDeclarativeState *state); + protected: QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent = 0); + +private: + Q_DECLARE_PRIVATE(QDeclarativeStateOperation) + Q_DISABLE_COPY(QDeclarativeStateOperation) }; typedef QDeclarativeStateOperation::ActionList QDeclarativeStateActions; @@ -169,6 +178,18 @@ public: QDeclarativeStateGroup *stateGroup() const; void setStateGroup(QDeclarativeStateGroup *); + bool containsPropertyInRevertList(QObject *target, const QByteArray &name) const; + bool changeValueInRevertList(QObject *target, const QByteArray &name, const QVariant &revertValue); + bool changeBindingInRevertList(QObject *target, const QByteArray &name, QDeclarativeAbstractBinding *binding); + bool removeEntryFromRevertList(QObject *target, const QByteArray &name); + void addEntryToRevertList(const QDeclarativeAction &action); + void removeAllEntriesFromRevertList(QObject *target); + void addEntriesToRevertList(const QList<QDeclarativeAction> &actions); + QVariant valueInRevertList(QObject *target, const QByteArray &name) const; + QDeclarativeAbstractBinding *bindingInRevertList(QObject *target, const QByteArray &name) const; + + bool isStateActive() const; + Q_SIGNALS: void completed(); |