diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-15 06:35:51 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-15 06:35:51 (GMT) |
commit | 30a3e78a12b72ab6f67992ec2f06cd4f21a01a6c (patch) | |
tree | bb480e0a908016f24a4e57755b2265ebf5b5ea16 /src/declarative/qml/qdeclarativecomponent_p.h | |
parent | 6362d17d5551749618f5975e050c54fca31c408f (diff) | |
download | Qt-30a3e78a12b72ab6f67992ec2f06cd4f21a01a6c.zip Qt-30a3e78a12b72ab6f67992ec2f06cd4f21a01a6c.tar.gz Qt-30a3e78a12b72ab6f67992ec2f06cd4f21a01a6c.tar.bz2 |
Add Component.onDestruction attached property
This property complements Component.onCompleted. It is emitted before
the destruction actually begins (for the most part) so the objects are
still alive and accessible.
The QtObject.onDestroyed signal is now blocked as it never really worked
properly anyway.
Diffstat (limited to 'src/declarative/qml/qdeclarativecomponent_p.h')
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent_p.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h index dfd0fc3..24e5386 100644 --- a/src/declarative/qml/qdeclarativecomponent_p.h +++ b/src/declarative/qml/qdeclarativecomponent_p.h @@ -99,10 +99,10 @@ public: QDeclarativeCompiledData *cc; struct ConstructionState { - ConstructionState() : componentAttacheds(0), completePending(false) {} + ConstructionState() : componentAttached(0), completePending(false) {} QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> > bindValues; QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> > parserStatus; - QDeclarativeComponentAttached *componentAttacheds; + QDeclarativeComponentAttached *componentAttached; QList<QDeclarativeError> errors; bool completePending; }; @@ -132,13 +132,24 @@ public: QDeclarativeComponentAttached(QObject *parent = 0); ~QDeclarativeComponentAttached(); + void add(QDeclarativeComponentAttached **a) { + prev = a; next = *a; *a = this; + if (next) next->prev = &next; + } + void rem() { + if (next) next->prev = prev; + *prev = next; + next = 0; prev = 0; + } QDeclarativeComponentAttached **prev; QDeclarativeComponentAttached *next; Q_SIGNALS: void completed(); + void destruction(); private: + friend class QDeclarativeContextData;; friend class QDeclarativeComponentPrivate; }; |