summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativebinding_p.h
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2010-09-14 14:43:47 (GMT)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2010-09-14 14:43:47 (GMT)
commit6454f4db1697af1d36ad4c0ea83ccd0bb490fd39 (patch)
treec0971fdbf74a70d5d1c1a31b9dfcc4411bceb099 /src/declarative/qml/qdeclarativebinding_p.h
parent37b9c2df53b281bddee26291855e0c7f01f52a7c (diff)
downloadQt-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/qml/qdeclarativebinding_p.h')
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 598f09f..f38ed23 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -67,6 +67,8 @@ QT_BEGIN_NAMESPACE
class Q_DECLARATIVE_EXPORT QDeclarativeAbstractBinding
{
public:
+ typedef QWeakPointer<QDeclarativeAbstractBinding> Pointer;
+
QDeclarativeAbstractBinding();
virtual void destroy();
@@ -86,6 +88,8 @@ public:
void addToObject(QObject *);
void removeFromObject();
+ Pointer weakPointer();
+
protected:
virtual ~QDeclarativeAbstractBinding();
void clear();
@@ -96,11 +100,13 @@ private:
friend class QDeclarativeValueTypeProxyBinding;
friend class QDeclarativePropertyPrivate;
friend class QDeclarativeVME;
+ friend class QtSharedPointer::ExternalRefCount<QDeclarativeAbstractBinding>;
QObject *m_object;
QDeclarativeAbstractBinding **m_mePtr;
QDeclarativeAbstractBinding **m_prevBinding;
QDeclarativeAbstractBinding *m_nextBinding;
+ QSharedPointer<QDeclarativeAbstractBinding> m_selfPointer;
};
class QDeclarativeValueTypeProxyBinding : public QDeclarativeAbstractBinding