diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-19 02:11:54 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-19 02:11:54 (GMT) |
commit | ab08c7d19ae854a8ffdcc47c9ed4094b593297fa (patch) | |
tree | bb58e412cc2726dfc08465b19ee9fe252af75dd6 /src/declarative | |
parent | aba0e4689a14fd5c42c7a420072a464a850a119e (diff) | |
parent | fb6a6063ef17d188494d1832e7bd669f0391b55d (diff) | |
download | Qt-ab08c7d19ae854a8ffdcc47c9ed4094b593297fa.zip Qt-ab08c7d19ae854a8ffdcc47c9ed4094b593297fa.tar.gz Qt-ab08c7d19ae854a8ffdcc47c9ed4094b593297fa.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/util/qmlbind.cpp | 14 | ||||
-rw-r--r-- | src/declarative/util/qmlbind_p.h | 7 | ||||
-rw-r--r-- | src/declarative/util/qmlpackage.cpp | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp index b8ab53e..2f692d8 100644 --- a/src/declarative/util/qmlbind.cpp +++ b/src/declarative/util/qmlbind.cpp @@ -55,9 +55,10 @@ QT_BEGIN_NAMESPACE class QmlBindPrivate : public QObjectPrivate { public: - QmlBindPrivate() : when(true), obj(0) {} + QmlBindPrivate() : when(true), componentComplete(false), obj(0) {} - bool when; + bool when : 1; + bool componentComplete : 1; QObject *obj; QString prop; QmlNullableValue<QVariant> value; @@ -176,10 +177,17 @@ void QmlBind::setValue(const QVariant &v) eval(); } +void QmlBind::componentComplete() +{ + Q_D(QmlBind); + d->componentComplete = true; + eval(); +} + void QmlBind::eval() { Q_D(QmlBind); - if (!d->obj || d->value.isNull || !d->when) + if (!d->obj || d->value.isNull || !d->when || !d->componentComplete) return; QmlMetaProperty prop(d->obj, d->prop); diff --git a/src/declarative/util/qmlbind_p.h b/src/declarative/util/qmlbind_p.h index a9b7b98..4d85698 100644 --- a/src/declarative/util/qmlbind_p.h +++ b/src/declarative/util/qmlbind_p.h @@ -52,11 +52,11 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QmlBindPrivate; -class Q_DECLARATIVE_EXPORT QmlBind : public QObject +class Q_DECLARATIVE_EXPORT QmlBind : public QObject, public QmlParserStatus { Q_OBJECT Q_DECLARE_PRIVATE(QmlBind) - + Q_INTERFACES(QmlParserStatus) Q_PROPERTY(QObject *target READ object WRITE setObject) Q_PROPERTY(QString property READ property WRITE setProperty) Q_PROPERTY(QVariant value READ value WRITE setValue) @@ -78,6 +78,9 @@ public: QVariant value() const; void setValue(const QVariant &); +protected: + virtual void componentComplete(); + private: void eval(); }; diff --git a/src/declarative/util/qmlpackage.cpp b/src/declarative/util/qmlpackage.cpp index 908b368..6bc1ef9 100644 --- a/src/declarative/util/qmlpackage.cpp +++ b/src/declarative/util/qmlpackage.cpp @@ -101,7 +101,7 @@ QmlPackage::~QmlPackage() Q_D(QmlPackage); for (int ii = 0; ii < d->dataList.count(); ++ii) { QObject *obj = d->dataList.at(ii); - delete obj; + obj->setParent(this); } } |