AnimatedPixmap Class Reference

#include <animatedpixmap.h>

List of all members.

Signals

void frameChanged (int frameNumber)

Public Member Functions

 AnimatedPixmap ()
 AnimatedPixmap (const QString &fileName)
void start ()
void stop ()
int frameCount () const
QPixmap currentFrame () const
void setFrameDelay (int frameDelay)
void setPixmap (const QPixmap &pixmap)

Private Slots

void frameTimeout ()

Private Attributes

QPixmap _pixmap
int _frameNumber
QTimer _frameTimer


Detailed Description

Provides an animated pixmap that can be used even if Qt was compiled without GIF support (which it is, by default) or the system doesn't have a libmng available by default (OS X, for example, usually doesn't). Animated pixmaps should have a series of square frames adjoined horizontally in a single image file.

Definition at line 28 of file animatedpixmap.h.


Constructor & Destructor Documentation

AnimatedPixmap::AnimatedPixmap (  ) 

Default constructor.

Definition at line 23 of file animatedpixmap.cpp.

References _frameTimer, and frameTimeout().

AnimatedPixmap::AnimatedPixmap ( const QString &  fileName  ) 

Creates an animated pixmap from the specified file.

Definition at line 31 of file animatedpixmap.cpp.

References _frameTimer, frameTimeout(), and setPixmap().


Member Function Documentation

void AnimatedPixmap::start (  ) 

Starts the animation.

Definition at line 40 of file animatedpixmap.cpp.

References _frameNumber, and _frameTimer.

Referenced by VClickLabel::setAnimation().

void AnimatedPixmap::stop (  ) 

Stops the animated image.

Definition at line 48 of file animatedpixmap.cpp.

References _frameTimer.

Referenced by VClickLabel::setPixmap().

int AnimatedPixmap::frameCount (  )  const

Returns the number of frames in the animation.

Definition at line 70 of file animatedpixmap.cpp.

References _pixmap.

Referenced by frameTimeout().

QPixmap AnimatedPixmap::currentFrame (  )  const

Returns the current animation frame.

Definition at line 85 of file animatedpixmap.cpp.

References _frameNumber, and _pixmap.

Referenced by VClickLabel::animationFrameChanged().

void AnimatedPixmap::setFrameDelay ( int  frameDelay  ) 

Sets the duration of each animation frame to frameDelay.

Definition at line 55 of file animatedpixmap.cpp.

References _frameTimer.

void AnimatedPixmap::setPixmap ( const QPixmap &  pixmap  ) 

Sets the source image for the animation to pixmap.

Definition at line 62 of file animatedpixmap.cpp.

References _frameNumber, and _pixmap.

Referenced by AnimatedPixmap(), and VClickLabel::setAnimation().

void AnimatedPixmap::frameChanged ( int  frameNumber  )  [signal]

Emitted when the current frame has changed. frameNumber contains the current frame number.

Referenced by frameTimeout().

void AnimatedPixmap::frameTimeout (  )  [private, slot]

Called when the current animation frame should be changed.

Definition at line 77 of file animatedpixmap.cpp.

References _frameNumber, frameChanged(), and frameCount().

Referenced by AnimatedPixmap().


Member Data Documentation

QPixmap AnimatedPixmap::_pixmap [private]

Source image for the animation frames.

Definition at line 61 of file animatedpixmap.h.

Referenced by currentFrame(), frameCount(), and setPixmap().

Current animation frame number.

Definition at line 62 of file animatedpixmap.h.

Referenced by currentFrame(), frameTimeout(), setPixmap(), and start().

QTimer AnimatedPixmap::_frameTimer [private]

Timer to control the delay between frames.

Definition at line 63 of file animatedpixmap.h.

Referenced by AnimatedPixmap(), setFrameDelay(), start(), and stop().


The documentation for this class was generated from the following files:

Generated on Sat Aug 16 17:38:36 2008 for Vidalia by  doxygen 1.5.6