KDE 4.9 PyKDE API Reference

- KDE's Python API

# Animator Class Reference

`from PyKDE4.plasma import *`

Inherits: QObject
Namespace: Plasma

## Detailed Description

Animator plasma/animator.h <Plasma/Animator>

A system for applying effects to Plasma elements

## Enumerations

Animation | { AppearAnimation, DisappearAnimation, ActivateAnimation, FadeAnimation, GrowAnimation, PulseAnimation, RotationAnimation, RotationStackedAnimation, SlideAnimation, GeometryAnimation, ZoomAnimation, PixmapTransitionAnimation, WaterAnimation, LastAnimation }
CurveShape | { EaseInCurve, EaseOutCurve, EaseInOutCurve, LinearCurve, PendularCurve }
Movement | { SlideInMovement, SlideOutMovement, FastSlideInMovement, FastSlideOutMovement }

## Signals

| animationFinished (QGraphicsItem item, Plasma.Animator.Animation anim)
| customAnimationFinished (int id)
| elementAnimationFinished (int id)
| movementFinished (QGraphicsItem item)
| scrollStateChanged (QGraphicsWidget widget, QAbstractAnimation::State newState, QAbstractAnimation::State oldState)

## Methods

| __init__ (self, QObject parent=0)
int | animateElement (self, QGraphicsItem obj, Plasma.Animator.Animation a1)
int | animateItem (self, QGraphicsItem item, Plasma.Animator.Animation anim)
QPixmap | currentPixmap (self, int id)
int | customAnimation (self, int frames, int duration, Plasma.Animator.CurveShape curve, QObject receiver, QString method)
bool | isAnimating (self)
int | moveItem (self, QGraphicsItem item, Plasma.Animator.Movement movement, QPoint destination)
| registerScrollingManager (self, QGraphicsWidget widget)
| setInitialPixmap (self, int id, QPixmap pixmap)
| stopCustomAnimation (self, int id)
| stopElementAnimation (self, int id)
| stopItemAnimation (self, int id)
| stopItemMovement (self, int id)
| timerEvent (self, QTimerEvent event)
| unregisterScrollingManager (self, QGraphicsWidget widget)

## Static Methods

Plasma.Animation | create (QString animationName, QObject parent=0)
QEasingCurve | create (Plasma.Animator.CurveShape type)
Plasma.Animator | self ()

## Signal Documentation

animationFinished | ( | QGraphicsItem | item,
|  | Plasma.Animator.Animation | anim
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("animationFinished(QGraphicsItem*, Plasma::Animator::Animation)"), target_slot)`

customAnimationFinished | ( | int | id
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("customAnimationFinished(int)"), target_slot)`

elementAnimationFinished | ( | int | id
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("elementAnimationFinished(int)"), target_slot)`

movementFinished | ( | QGraphicsItem | item
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("movementFinished(QGraphicsItem*)"), target_slot)`

scrollStateChanged | ( | QGraphicsWidget | widget,
|  | QAbstractAnimation::State | newState,
|  | QAbstractAnimation::State | oldState
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("scrollStateChanged(QGraphicsWidget*, QAbstractAnimation::State, QAbstractAnimation::State)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

int animateElement | ( | self, |
|  | QGraphicsItem | obj,
|  | Plasma.Animator.Animation | a1
| ) |  |  |

int animateItem | ( | self, |
|  | QGraphicsItem | item,
|  | Plasma.Animator.Animation | anim
| ) |  |  |

Starts a standard animation on a QGraphicsItem.

Parameters:

  | item | the item to animate in some fashion
  | anim | the type of animation to perform

Returns:
  the id of the animation

Deprecated:
  use new Animator API with Qt Kinetic

QPixmap currentPixmap | ( | self, |
|  | int | id
| ) |  |  |

int customAnimation | ( | self, |
|  | int | frames,
|  | int | duration,
|  | Plasma.Animator.CurveShape | curve,
|  | QObject | receiver,
|  | QString | method
| ) |  |  |

Starts a custom animation, preventing the need to create a timeline with its own timer tick.

Parameters:

  | frames | the number of frames this animation should persist for
  | duration | the length, in milliseconds, the animation will take
  | curve | the curve applied to the frame rate
  | receive | the object that will handle the actual animation
  | method | the method name of slot to be invoked on each update. It must take a qreal. So if the slot is animate(qreal), pass in "animate" as the method parameter. It has an optional integer paramenter that takes an integer that reapresents the animation id, useful if you want to manage multiple animations with a sigle slot

Returns:
  an id that can be used to identify this animation.

Deprecated:
  use new Animator API with Qt Kinetic

bool isAnimating | ( |  | self ) |

Can be used to query if there are other animations happening. This way heavy operations can be delayed until all animations are finished.

Returns:
  true if there are animations going on.

Since:
  4.1

Deprecated:
  use new Animator API with Qt Kinetic

int moveItem | ( | self, |
|  | QGraphicsItem | item,
|  | Plasma.Animator.Movement | movement,
|  | QPoint | destination
| ) |  |  |

Starts a standard animation on a QGraphicsItem.

Parameters:

  | item | the item to animate in some fashion
  | anim | the type of animation to perform

Returns:
  the id of the animation

Deprecated:
  use new Animator API with Qt Kinetic

registerScrollingManager | ( | self, |
|  | QGraphicsWidget | widget
| ) |  |  |

Register a widget as a scrolling widget. This function is deprecated: use a ScrollWidget, with setWidget() as your widget instead.

Parameters:

  | widget | the widget that offers a scrolling behaviour

Since:
  4.4

setInitialPixmap | ( | self, |
|  | int | id,
|  | QPixmap | pixmap
| ) |  |  |

stopCustomAnimation | ( | self, |
|  | int | id
| ) |  |  |

Stops a custom animation. Note that it is not necessary to call this on object destruction, as custom animations associated with a given QObject are cleaned up automatically on QObject destruction.

Parameters:

  | id | the id of the animation as returned by customAnimation

Deprecated:
  use new Animator API with Qt Kinetic

stopElementAnimation | ( | self, |
|  | int | id
| ) |  |  |

stopItemAnimation | ( | self, |
|  | int | id
| ) |  |  |

Stops an item animation before the animation is complete. Note that it is not necessary to call this on normal completion of the animation.

Parameters:

  | id | the id of the animation as returned by animateItem

Deprecated:
  use new Animator API with Qt Kinetic

stopItemMovement | ( | self, |
|  | int | id
| ) |  |  |

Stops an item movement before the animation is complete. Note that it is not necessary to call this on normal completion of the animation.

Parameters:

  | id | the id of the animation as returned by moveItem

Deprecated:
  use new Animator API with Qt Kinetic

timerEvent | ( | self, |
|  | QTimerEvent | event
| ) |  |  |

unregisterScrollingManager | ( | self, |
|  | QGraphicsWidget | widget
| ) |  |  |

unregister the scrolling manager of a certain widget This function is deprecated: use ScrollWidget instead.

Parameters:

  | widget | the widget we don't want no longer animated

Since:
  4.4

## Static Method Documentation

Plasma.Animation create | ( | QString | animationName,
|  | QObject | parent=0
| ) |  |  |

Factory to build new custom easing curves.

Since:
  4.5

QEasingCurve create | ( | Plasma.Animator.CurveShape | type
| ) |  |  |

Factory to build new custom easing curves.

Since:
  4.5

Plasma.Animator self | ( |  | ) |

Singleton accessor

## Enumeration Documentation

Animation

Enumerator:

CurveShape

Enumerator:

  EaseInCurve = 0 |
  EaseOutCurve |
  EaseInOutCurve |
  LinearCurve |
  PendularCurve |

Movement

Enumerator:

  SlideInMovement = 0 |
  SlideOutMovement |
  FastSlideInMovement |
  FastSlideOutMovement |