98 #include <private/qmutexpool_p.h> 100 #ifndef QT_NO_ANIMATION 140 void *argv[] = {
const_cast<void *
>(newValue.
constData()), const_cast<QVariant *>(&newValue), &
status, &flags };
189 return d_func()->target.data();
195 if (
d->targetValue == target)
199 qWarning(
"QPropertyAnimation::setTargetObject: you can't change the target of a running animation");
203 d->target =
d->targetValue = target;
204 d->updateMetaProperty();
220 return d->propertyName;
227 qWarning(
"QPropertyAnimation::setPropertyName: you can't change the property name of a running animation");
232 d->updateMetaProperty();
254 d->updateProperty(value);
271 if (!
d->target && oldState ==
Stopped) {
272 qWarning(
"QPropertyAnimation::updateState (%s): Changing state of an animation without target",
273 d->propertyName.constData());
286 static QPropertyAnimationHash
hash;
289 QPropertyAnimationPair
key(
d->targetValue,
d->propertyName);
291 d->updateMetaProperty();
292 animToStop = hash.value(key, 0);
293 hash.insert(key,
this);
296 d->setDefaultStartEndValue(
d->targetValue->property(
d->propertyName.constData()));
299 qWarning(
"QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value",
300 d->propertyName.constData(),
d->target.data()->metaObject()->className(),
303 if (!
endValue().isValid() && (
d->direction ==
Forward || !
d->defaultStartEndValue.isValid())) {
304 qWarning(
"QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value",
305 d->propertyName.constData(),
d->target.data()->metaObject()->className(),
309 }
else if (hash.value(key) ==
this) {
319 current = current->
group();
324 #include "moc_qpropertyanimation.cpp" 328 #endif //QT_NO_ANIMATION The QVariant class acts like a union for the most common Qt data types.
static uint hash(const uchar *p, int n)
The QPropertyAnimation class animates Qt properties.
#define QT_END_NAMESPACE
This macro expands to.
State
This enum describes the state of the animation.
bool event(QEvent *event)
Reimplemented Function
void convertValues(int t)
The QByteArray class provides an array of bytes.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
QVariant endValue() const
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
static LibLoadStatus status
The QHash class is a template class that provides a hash-table-based dictionary.
The QObject class is the base class of all Qt objects.
State state
state of the animation.
void stop()
Stops the animation.
QAnimationGroup * group() const
If this animation is part of a QAnimationGroup, this function returns a pointer to the group; otherwi...
void updateMetaProperty()
QAbstractAnimation::State state
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QVariantAnimation class provides an abstract base class for animations.
void updateProperty(const QVariant &)
Q_CORE_EXPORT void qWarning(const char *,...)
QObject * targetObject() const
void setPropertyName(const QByteArray &propertyName)
The QAbstractAnimation class is the base of all animations.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QVariant startValue() const
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
int userType() const
Returns the storage type of the value stored in the variant.
void updateCurrentValue(const QVariant &value)
This virtual function is called by QVariantAnimation whenever the current value changes.
QPropertyAnimation(QObject *parent=0)
Construct a QPropertyAnimation object.
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
If the startValue is not defined when the state of the animation changes from Stopped to Running...
void setTargetObject(QObject *target)
QObject * parent() const
Returns a pointer to the parent object.
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
Reimplemented Function
const void * constData() const
QByteArray propertyName() const
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
The QEvent class is the base class of all event classes.
#define qPrintable(string)
QWeakPointer< QObject > target
bool event(QEvent *event)
Reimplemented Function
static QMutex * globalInstanceGet(const void *address)
Returns a QMutex from the global mutex pool.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
~QPropertyAnimation()
Destroys the QPropertyAnimation instance.