diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-19 03:35:17 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-19 03:35:17 (GMT) |
commit | 02e81cd0262187e211a57958d8728981be2ab878 (patch) | |
tree | 3817ab88033003e86d88414b81c729d7599e26f7 /src/declarative/util | |
parent | a9a2b17b8a967c001137e12af570856d9ce4b937 (diff) | |
parent | ce914b37ee06e689af1bb5a2a1a932e9125f7276 (diff) | |
download | Qt-02e81cd0262187e211a57958d8728981be2ab878.zip Qt-02e81cd0262187e211a57958d8728981be2ab878.tar.gz Qt-02e81cd0262187e211a57958d8728981be2ab878.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qmlanimation_p_p.h | 32 | ||||
-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 | ||||
-rw-r--r-- | src/declarative/util/qmltransitionmanager.cpp | 6 |
5 files changed, 37 insertions, 24 deletions
diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h index 27c0cd7..cb1c642 100644 --- a/src/declarative/util/qmlanimation_p_p.h +++ b/src/declarative/util/qmlanimation_p_p.h @@ -1,7 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** @@ -9,8 +10,8 @@ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -20,21 +21,20 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ 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); } } diff --git a/src/declarative/util/qmltransitionmanager.cpp b/src/declarative/util/qmltransitionmanager.cpp index d1db9ec..ba726db 100644 --- a/src/declarative/util/qmltransitionmanager.cpp +++ b/src/declarative/util/qmltransitionmanager.cpp @@ -236,8 +236,11 @@ void QmlTransitionManager::transition(const QList<Action> &list, action.property.write(action.toValue); } } - if (!transition) + if (!transition) { d->applyBindings(); + if (d->state) + static_cast<QmlStatePrivate*>(QObjectPrivate::get(d->state))->complete(); + } } void QmlTransitionManager::cancel() @@ -262,7 +265,6 @@ void QmlTransitionManager::cancel() } d->bindingsList.clear(); d->completeList.clear(); - } QT_END_NAMESPACE |