summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-03-23 03:45:53 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-03-23 03:49:12 (GMT)
commit714fac87324b9007e5f82487d2c4a10b1997616e (patch)
tree8b0832ee6ad805badd5a9dc2b04a5bd68d2979cc
parent7711d400e4ad4d65363bc910d76acdf0d1065195 (diff)
downloadQt-714fac87324b9007e5f82487d2c4a10b1997616e.zip
Qt-714fac87324b9007e5f82487d2c4a10b1997616e.tar.gz
Qt-714fac87324b9007e5f82487d2c4a10b1997616e.tar.bz2
Add missing NOTIFYs.
Task-number: QTBUG-8816
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp12
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h11
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp14
-rw-r--r--src/declarative/util/qdeclarativetransition_p.h11
4 files changed, 41 insertions, 7 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 858f9f2..f644917 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -2277,7 +2277,11 @@ QDeclarativeItem *QDeclarativeParentAnimation::target() const
void QDeclarativeParentAnimation::setTarget(QDeclarativeItem *target)
{
Q_D(QDeclarativeParentAnimation);
+ if (target == d->target)
+ return;
+
d->target = target;
+ emit targetChanged();
}
/*!
@@ -2295,7 +2299,11 @@ QDeclarativeItem *QDeclarativeParentAnimation::newParent() const
void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent)
{
Q_D(QDeclarativeParentAnimation);
+ if (newParent == d->newParent)
+ return;
+
d->newParent = newParent;
+ emit newParentChanged();
}
/*!
@@ -2320,7 +2328,11 @@ QDeclarativeItem *QDeclarativeParentAnimation::via() const
void QDeclarativeParentAnimation::setVia(QDeclarativeItem *via)
{
Q_D(QDeclarativeParentAnimation);
+ if (via == d->via)
+ return;
+
d->via = via;
+ emit viaChanged();
}
//### mirrors same-named function in QDeclarativeItem
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index cb8ea3b..356b015 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -430,9 +430,9 @@ class QDeclarativeParentAnimation : public QDeclarativeAnimationGroup
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeParentAnimation)
- Q_PROPERTY(QDeclarativeItem *target READ target WRITE setTarget)
- Q_PROPERTY(QDeclarativeItem *newParent READ newParent WRITE setNewParent)
- Q_PROPERTY(QDeclarativeItem *via READ via WRITE setVia)
+ Q_PROPERTY(QDeclarativeItem *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(QDeclarativeItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
+ Q_PROPERTY(QDeclarativeItem *via READ via WRITE setVia NOTIFY viaChanged)
public:
QDeclarativeParentAnimation(QObject *parent=0);
@@ -447,6 +447,11 @@ public:
QDeclarativeItem *via() const;
void setVia(QDeclarativeItem *);
+Q_SIGNALS:
+ void targetChanged();
+ void newParentChanged();
+ void viaChanged();
+
protected:
virtual void transition(QDeclarativeStateActions &actions,
QDeclarativeProperties &modified,
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index ac07b10..4326a55 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
\ingroup group_states
*/
-//ParallelAnimationWrapperallows us to do a "callback" when the animation finishes, rather than connecting
+//ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting
//and disconnecting signals and slots frequently
class ParallelAnimationWrapper : public QParallelAnimationGroup
{
@@ -195,7 +195,11 @@ QString QDeclarativeTransition::fromState() const
void QDeclarativeTransition::setFromState(const QString &f)
{
Q_D(QDeclarativeTransition);
+ if (f == d->fromState)
+ return;
+
d->fromState = f;
+ emit fromChanged();
}
/*!
@@ -213,7 +217,11 @@ bool QDeclarativeTransition::reversible() const
void QDeclarativeTransition::setReversible(bool r)
{
Q_D(QDeclarativeTransition);
+ if (r == d->reversible)
+ return;
+
d->reversible = r;
+ emit reversibleChanged();
}
QString QDeclarativeTransition::toState() const
@@ -225,7 +233,11 @@ QString QDeclarativeTransition::toState() const
void QDeclarativeTransition::setToState(const QString &t)
{
Q_D(QDeclarativeTransition);
+ if (t == d->toState)
+ return;
+
d->toState = t;
+ emit toChanged();
}
/*!
diff --git a/src/declarative/util/qdeclarativetransition_p.h b/src/declarative/util/qdeclarativetransition_p.h
index 861111a..2f9e7b5 100644
--- a/src/declarative/util/qdeclarativetransition_p.h
+++ b/src/declarative/util/qdeclarativetransition_p.h
@@ -62,9 +62,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTransition : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeTransition)
- Q_PROPERTY(QString from READ fromState WRITE setFromState)
- Q_PROPERTY(QString to READ toState WRITE setToState)
- Q_PROPERTY(bool reversible READ reversible WRITE setReversible)
+ Q_PROPERTY(QString from READ fromState WRITE setFromState NOTIFY fromChanged)
+ Q_PROPERTY(QString to READ toState WRITE setToState NOTIFY toChanged)
+ Q_PROPERTY(bool reversible READ reversible WRITE setReversible NOTIFY reversibleChanged)
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations)
Q_CLASSINFO("DefaultProperty", "animations")
Q_CLASSINFO("DeferredPropertyNames", "animations")
@@ -90,6 +90,11 @@ public:
void setReversed(bool r);
void stop();
+
+Q_SIGNALS:
+ void fromChanged();
+ void toChanged();
+ void reversibleChanged();
};
QT_END_NAMESPACE