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 38 of file animatedpixmap.h.


Constructor & Destructor Documentation

AnimatedPixmap::AnimatedPixmap (  ) 

Default constructor.

Definition at line 34 of file animatedpixmap.cpp.

References _frameTimer, and frameTimeout().

AnimatedPixmap::AnimatedPixmap ( const QString &  fileName  ) 

Creates an animated pixmap from the specified file.

Definition at line 42 of file animatedpixmap.cpp.

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


Member Function Documentation

void AnimatedPixmap::start (  ) 

Starts the animation.

Definition at line 51 of file animatedpixmap.cpp.

References _frameNumber, and _frameTimer.

Referenced by VClickLabel::setAnimation().

void AnimatedPixmap::stop (  ) 

Stops the animated image.

Definition at line 59 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 81 of file animatedpixmap.cpp.

References _pixmap.

Referenced by frameTimeout().

QPixmap AnimatedPixmap::currentFrame (  )  const

Returns the current animation frame.

Definition at line 96 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 66 of file animatedpixmap.cpp.

References _frameTimer.

void AnimatedPixmap::setPixmap ( const QPixmap &  pixmap  ) 

Sets the source image for the animation to pixmap.

Definition at line 73 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 88 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 71 of file animatedpixmap.h.

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

int AnimatedPixmap::_frameNumber [private]

Current animation frame number.

Definition at line 72 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 73 of file animatedpixmap.h.

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


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 15:49:29 2007 for Vidalia by  doxygen 1.5.3