42 #include "private/qdeclarativebehavior_p.h" 44 #include "private/qdeclarativeanimation_p.h" 45 #include "private/qdeclarativetransition_p.h" 53 #include <private/qobject_p.h> 133 qmlInfo(
this) <<
tr(
"Cannot change the animation assigned to a Behavior.");
139 d->animation->setDefaultTarget(
d->property);
140 d->animation->setDisableUserControl();
141 connect(
d->animation->qtAnimation(),
152 if (!
d->blockRunningChanged)
178 if (
d->enabled == enabled)
188 if (!
d->animation || !
d->enabled || !
d->finalized) {
190 d->targetValue = value;
194 if (
d->animation->isRunning() && value ==
d->targetValue)
197 d->currentValue =
d->property.read();
198 d->targetValue = value;
200 if (
d->animation->qtAnimation()->duration() != -1
202 d->blockRunningChanged =
true;
203 d->animation->qtAnimation()->stop();
215 d->animation->qtAnimation()->start();
216 d->blockRunningChanged =
false;
225 d->currentValue =
property.read();
227 d->animation->setDefaultTarget(property);
void setEnabled(bool enabled)
The QVariant class acts like a union for the most common Qt data types.
void setAnimation(QDeclarativeAbstractAnimation *)
QDeclarativeProperty property
#define QT_END_NAMESPACE
This macro expands to.
State
This enum describes the state of the animation.
virtual void setTarget(const QDeclarativeProperty &)
Set the target property for the value interceptor.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QObject class is the base class of all Qt objects.
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
virtual void write(const QVariant &value)
This method will be called when a new value is assigned to the property being intercepted.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *)
void registerFinalizedParserStatusObject(QObject *obj, int index)
QDeclarativeProperty property
#define Q_DECLARE_PUBLIC(Class)
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
QDeclarativeGuard< QDeclarativeAbstractAnimation > animation
void qtAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State)
QVariant property(const char *name) const
Returns the value of the object's name property.
The QDeclarativeProperty class abstracts accessing properties on objects created from QML...
void componentFinalized()
QDeclarativeInfo qmlInfo(const QObject *me)
QDeclarativeBehaviorPrivate()
QDeclarativeBehavior(QObject *parent=0)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
QDeclarativeAbstractAnimation * animation()
static bool write(QObject *, const QDeclarativePropertyCache::Data &, const QVariant &, QDeclarativeContextData *, WriteFlags flags=0)