|  | Home

# QtPropertyAnimation Class Reference
[QtCore module]

The QtPropertyAnimation class animates properties for QObject(and QWidget) More...

     #include <QtPropertyAnimation>

This class is under development and is subject to change.

Inherits QtAnimation.

- List of all members, including inherited members

### Properties

- propertyName : QByteArray
- targetObject : QObject *

- 5 properties inherited from QtAnimation
- 6 properties inherited from QtAbstractAnimation
- 1 property inherited from QObject

### Public Functions

- QtPropertyAnimation ( QObject * parent = 0 )
- QtPropertyAnimation ( QObject * target, const QByteArray & propertyName, QObject * parent = 0 )
- ~QtPropertyAnimation ()
- QByteArray propertyName () const
- void setPropertyName ( const QByteArray & propertyName )
- void setTargetObject ( QObject * target )
- QObject * targetObject () const

- 13 public functions inherited from QtAnimation
- 10 public functions inherited from QtAbstractAnimation
- 29 public functions inherited from QObject

### Static Public Members

- QtPropertyAnimation * runningAnimation ( QObject * object, QByteArray prop )
- QList<QtPropertyAnimation *> runningAnimations ( QObject * object = 0 )

- 4 static public members inherited from QObject

### Protected Functions

- virtual void updateCurrentValue ( const QVariant & value )

- 4 protected functions inherited from QtAnimation
- 3 protected functions inherited from QtAbstractAnimation
- 7 protected functions inherited from QObject

### Additional Inherited Members

- 5 public slots inherited from QtAbstractAnimation
- 1 public slot inherited from QObject
- 2 signals inherited from QtAnimation
- 5 signals inherited from QtAbstractAnimation
- 1 signal inherited from QObject
- 1 public type inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QtPropertyAnimation class animates properties for QObject(and QWidget)

This class is part of {The Animation Framework}. You can use QtPropertyAnimation by itself as a simple animation class, or as part of more complex animations through QtAnimationGroup.

The most common way to use QtPropertyAnimation is to construct an instance of it by passing a pointer to a QObject or a QWidget, and the name of the property you would like to animate to QtPropertyAnimation's constructor.

The start value of the animation is optional. If you do not set any start value, the animation will operate on the target's current property value at the point when the animation was started. You can call setStartValue() to set the start value, and setEndValue() to set the target value for the animated property.

Animations can operate on QObjects and QWidgets. You can choose to assign a target object by either calling setTargetObject() or by passing a QObject pointer to QtPropertyAnimation's constructor.

See also QtAnimation, QtAnimationGroup, and The Animation Framework.

## Property Documentation

### propertyName : QByteArray

This property holds the target property name for this animation.

This property defines the target property name for this animation. The property name is required for the animation to operate.

Access functions:

- QByteArray propertyName () const
- void setPropertyName ( const QByteArray & propertyName )

### targetObject : QObject *

This property holds the target QObject for this animation.

This property defines the target QObject for this animation.

Access functions:

- QObject * targetObject () const
- void setTargetObject ( QObject * target )

## Member Function Documentation

### QtPropertyAnimation::QtPropertyAnimation ( QObject * parent = 0 )

Construct a QtPropertyAnimation object. parent is passed to QObject's constructor.

### QtPropertyAnimation::QtPropertyAnimation ( QObject * target, const QByteArray & propertyName, QObject * parent = 0 )

Construct a QtPropertyAnimation object. parent is passed to QObject's constructor. The animation changes the property propertyName on target. The default duration is 250ms.

See also targetObject and propertyName.

### QtPropertyAnimation::~QtPropertyAnimation ()

Destroys the QtPropertyAnimation instance.

### QtPropertyAnimation * QtPropertyAnimation::runningAnimation ( QObject * object, QByteArray prop ) `[static]`

This static function returns the running animations on object and on property prop.

### QList<QtPropertyAnimation *> QtPropertyAnimation::runningAnimations ( QObject * object = 0 ) `[static]`

This static function returns the list of running animations on object. If object is 0, then it returns all QtPropertyAnimations running on all QObjects.

### void QtPropertyAnimation::updateCurrentValue ( const QVariant & value ) `[virtual protected]`

This virtual function is called by QtAnimation whenever the current value changes. value is the new, updated value. It updates the current value of the property on the target object.

Reimplemented from QtAnimation.

See also currentValue and currentTime.