KDE 4.2 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 }
CurveShape | { EaseInCurve, EaseOutCurve, EaseInOutCurve, LinearCurve }
Movement | { SlideInMovement, SlideOutMovement, FastSlideInMovement, FastSlideOutMovement }

## Signals

| animationFinished (QGraphicsItem item, Plasma.Animator.Animation anim)
| customAnimationFinished (int id)
| elementAnimationFinished (int id)
| movementFinished (QGraphicsItem item)

## Methods

| __init__ (self, QObject parent=0)
int | animateElement (self, QGraphicsItem obj, Plasma.Animator.Animation a0)
int | animateItem (self, QGraphicsItem item, Plasma.Animator.Animation anim)
| animationFinished (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)
| customAnimationFinished (self, int id)
| elementAnimationFinished (self, int id)
bool | isAnimating (self)
int | moveItem (self, QGraphicsItem item, Plasma.Animator.Movement movement, QPoint destination)
| movementFinished (self, QGraphicsItem item)
| 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)

## Static Methods

Plasma.Animator | self ()

## Method Documentation

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

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

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

Starts a standard animation on a QGraphicsItem.

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

Returns:
  the id of the animation

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

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

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.

@arg frames the number of frames this animation should persist for @arg duration the length, in milliseconds, the animation will take @arg curve the curve applied to the frame rate @arg receive the object that will handle the actual animation @arg 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.

customAnimationFinished | ( | self, |
|  | int | id
| ) |  |  |

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

elementAnimationFinished | ( | self, |
|  | int | id
| ) |  |  |

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

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

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

Starts a standard animation on a QGraphicsItem.

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

Returns:
  the id of the animation

movementFinished | ( | self, |
|  | QGraphicsItem | item
| ) |  |  |

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

Plasma.Animator self | ( |  | ) |

Singleton accessor

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.

@arg id the id of the animation as returned by customAnimation

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.

@arg id the id of the animation as returned by animateItem

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.

@arg id the id of the animation as returned by moveItem

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

## Enumeration Documentation

Animation

Enumerator:

  AppearAnimation = 0 |
  DisappearAnimation |
  ActivateAnimation |

CurveShape

Enumerator:

  EaseInCurve = 0 |
  EaseOutCurve |
  EaseInOutCurve |
  LinearCurve |

Movement

Enumerator:

  SlideInMovement = 0 |
  SlideOutMovement |
  FastSlideInMovement |
  FastSlideOutMovement |