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

MParallelAnimationGroup Class Reference

MParallelAnimationGroup provides styling support for QParallelAnimationGroup. More...

Inheritance diagram for MParallelAnimationGroup:
Inheritance graph
[legend]
Collaboration diagram for MParallelAnimationGroup:
Collaboration graph
[legend]

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);
      }
 };

Definition at line 86 of file corelib/animation/core/mparallelanimationgroup.h.


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

Definition at line 37 of file mparallelanimationgroup.cpp.

                                                                :
    QParallelAnimationGroup(parent),
    d_ptr(new MParallelAnimationGroupPrivate)
{
    Q_D(MParallelAnimationGroup);
    d->q_ptr = this;
    d->styleContainer = 0;
}

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.

Definition at line 47 of file mparallelanimationgroup.cpp.

{
    Q_D(MParallelAnimationGroup);

    delete d->styleContainer;
    delete d_ptr;
}


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.

Definition at line 85 of file mparallelanimationgroup.cpp.

{
    return new MAnimationStyleContainer();
}

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.

Definition at line 67 of file mparallelanimationgroup.cpp.

{
    Q_D(const MParallelAnimationGroup);

    if (!d->styleContainer) {
        MParallelAnimationGroupPrivate *d_p = const_cast<MParallelAnimationGroupPrivate *>(d);
        d_p->styleContainer = createStyleContainer();
        d_p->styleContainer->initialize(objectName(), "", NULL);
    }

    return *d->styleContainer;
}

Here is the call graph for this function:

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.

Definition at line 55 of file mparallelanimationgroup.cpp.

{
    Q_D(MParallelAnimationGroup);

    if (!d->styleContainer) {
        d->styleContainer = createStyleContainer();
        d->styleContainer->initialize(objectName(), "", NULL);
    }

    return *d->styleContainer;
}

Here is the call graph for this function:

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.

Definition at line 80 of file mparallelanimationgroup.cpp.

{
    return "MAnimationStyle";
}


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:26 (PDT)
Doxygen 1.7.1
MeeGo Touch