Home · All Classes · Main Classes · Deprecated
Public Member Functions | Protected Member Functions

MParallelAnimationGroup Class Reference

MParallelAnimationGroup provides styling support for QParallelAnimationGroup. More...

Inherits QParallelAnimationGroup.

Inherited by MAbstractWidgetAnimation, MOrientationAnimation, and MPageSwitchAnimation.

List of all members.

Public Member Functions

 MParallelAnimationGroup (QObject *parent=NULL)
virtual ~MParallelAnimationGroup ()

Protected Member Functions

MAnimationStyleContainerstyle ()
const MAnimationStyleContainerstyle () const
virtual const char * styleType () const
virtual MAnimationStyleContainercreateStyleContainer () const

Detailed Description

MParallelAnimationGroup provides styling support for QParallelAnimationGroup.

This class extends QParallelAnimationGroup with a style() function, through which a MAnimationStyleContainer derived class can be obtained containing a set of animation properties read from CSS.

This class is not meant to be used directly, itstead it serves as a base class for other animations. Classes deriving from MParallelAnimationGroup should implement a style derived from MAnimationStyle that describes the style properties of the animations in the group.

Classes inheriting MParallelAnimationGroup need to include the M_ANIMATION_GROUP macro in the class definiton, specifying the classname of the style to be used. For example:

 // Fade out the given item with the duration and easing defined in the style
 class FadeOutAnimation : public MParallelAnimationGroup {
      Q_OBJECT
      M_ANIMATION_GROUP(FadeOutAnimationStyle)

      public:
      FadeOutAnimation(QGraphicsItem *item, QObject *parent = NULL)
          : MParallelAnimationGroup(parent)
      {
          QPropertyAnimation *opacityAnimation = new QPropertyAnimation;
          opacityAnimation->setPropertyName("opacity");
          opacityAnimation->setEasingCurve(style()->easingCurve());
          opacityAnimation->setDuration(style()->duration());
          opacityAnimation->setEndValue(0.0);
          opacityAnimation->setTargetObject(item);

          addAnimation(opacityAnimation);
      }
 };

Constructor & Destructor Documentation

MParallelAnimationGroup::MParallelAnimationGroup ( QObject parent = NULL  ) 

Constructs the MParallelAnimationGroup base class, and passes parent to the QParallelAnimationGroup's constructor.

See also:
QParallelAnimationGroup, QAnimationGroup, QVariantAnimation
MParallelAnimationGroup::~MParallelAnimationGroup (  )  [virtual]

Stops the animation if it's running, then destroys the MParallelAnimationGroup.

If the animation is part of a QAnimationGroup, it is automatically removed before it's destroyed.


Member Function Documentation

MAnimationStyleContainer * MParallelAnimationGroup::createStyleContainer (  )  const [protected, virtual]

Instantiates a style container for this animation.

The M_ANIMATION macro, added to inheriting classes, overrides this method to return the correct type.

const MAnimationStyleContainer & MParallelAnimationGroup::style (  )  const [protected]

Returns a style container object for this animation - const version.

The M_ANIMATION_GROUP macro, added to inheriting classes, overrides this method to return the correct type.

MAnimationStyleContainer & MParallelAnimationGroup::style (  )  [protected]

Returns a style container object for this animation.

The M_ANIMATION_GROUP macro, added to inheriting classes, overrides this method to return the correct type.

const char * MParallelAnimationGroup::styleType (  )  const [protected, virtual]

Returns the type of the style this animation uses.

This is the name used in the CSS file.

The M_ANIMATION_GROUP macro, added to inheriting classes, overrides this method to return the correct type.


Copyright © 2010 Nokia Corporation
MeeGo Touch