summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-07-08 05:57:58 (GMT)
committermae <qt-info@nokia.com>2010-07-08 05:57:58 (GMT)
commit5cd72b07d202b487ca42486dfefc99ba2fff0045 (patch)
treef99ec9c2dd92f25349d5145589037400adfe70cf /src/declarative
parenta2ee0cfd799f563f292e6b40ca460e05819fd0fd (diff)
downloadQt-5cd72b07d202b487ca42486dfefc99ba2fff0045.zip
Qt-5cd72b07d202b487ca42486dfefc99ba2fff0045.tar.gz
Qt-5cd72b07d202b487ca42486dfefc99ba2fff0045.tar.bz2
Optimization: change signal/slot to function call
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp4
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h6
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp6
-rw-r--r--src/declarative/util/qdeclarativebehavior_p.h1
4 files changed, 7 insertions, 10 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 6559bd5..bdb9510 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -142,8 +142,8 @@ bool QDeclarativeAbstractAnimation::isRunning() const
return d->running;
}
-// the behavior connects the animation to this slot
-void QDeclarativeAbstractAnimation::behaviorControlRunningChanged(bool running)
+// the behavior calls this function
+void QDeclarativeAbstractAnimation::notifyRunningChanged(bool running)
{
Q_D(QDeclarativeAbstractAnimation);
if (d->disableUserControl && d->running != running) {
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index 2279b0e..59bd465 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -134,10 +134,12 @@ public:
private Q_SLOTS:
void timelineComplete();
void componentFinalized();
- void behaviorControlRunningChanged(bool running);
-
private:
virtual void setTarget(const QDeclarativeProperty &);
+ void notifyRunningChanged(bool running);
+ friend class QDeclarativeBehavior;
+
+
};
class QDeclarativePauseAnimationPrivate;
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 4480e75..2bb28c3 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -138,10 +138,6 @@ void QDeclarativeBehavior::setAnimation(QDeclarativeAbstractAnimation *animation
SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
this,
SLOT(qtAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
- connect(this,
- SIGNAL(qtAnimationRunningChanged(bool)),
- d->animation,
- SLOT(behaviorControlRunningChanged(bool)));
}
}
@@ -150,7 +146,7 @@ void QDeclarativeBehavior::qtAnimationStateChanged(QAbstractAnimation::State new
{
Q_D(QDeclarativeBehavior);
if (!d->blockRunningChanged)
- emit qtAnimationRunningChanged(newState == QAbstractAnimation::Running);
+ d->animation->notifyRunningChanged(newState == QAbstractAnimation::Running);
}
diff --git a/src/declarative/util/qdeclarativebehavior_p.h b/src/declarative/util/qdeclarativebehavior_p.h
index a3132d9..9801fb2 100644
--- a/src/declarative/util/qdeclarativebehavior_p.h
+++ b/src/declarative/util/qdeclarativebehavior_p.h
@@ -83,7 +83,6 @@ public:
Q_SIGNALS:
void enabledChanged();
- void qtAnimationRunningChanged(bool running);
private Q_SLOTS:
void componentFinalized();