QMovie

Section: Misc. Reference Manual Pages (3qt)
Updated: 2 February 2007
Index Return to Main Contents
 

NAME

QMovie - Incremental loading of animations or images, signalling as it progresses  

SYNOPSIS

#include <qmovie.h>

 

Public Members


QMovie ()

QMovie ( int bufsize )

QMovie ( QDataSource * src, int bufsize = 1024 )

QMovie ( const QString & fileName, int bufsize = 1024 )

QMovie ( QByteArray data, int bufsize = 1024 )

QMovie ( const QMovie & movie )

~QMovie ()

QMovie & operator= ( const QMovie & movie )

int pushSpace () const

void pushData ( const uchar * data, int length )

const QColor & backgroundColor () const

void setBackgroundColor ( const QColor & c )

const QRect & getValidRect () const

const QPixmap & framePixmap () const

const QImage & frameImage () const

bool isNull () const

int frameNumber () const

int steps () const

bool paused () const

bool finished () const

bool running () const

void unpause ()

void pause ()

void step ()

void step ( int steps )

void restart ()

int speed () const

void setSpeed ( int percent )

void connectResize ( QObject * receiver, const char * member )

void disconnectResize ( QObject * receiver, const char * member = 0 )

void connectUpdate ( QObject * receiver, const char * member )

void disconnectUpdate ( QObject * receiver, const char * member = 0 )

enum Status { SourceEmpty = -2, UnrecognizedFormat = -1, Paused = 1, EndOfFrame = 2, EndOfLoop = 3, EndOfMovie = 4, SpeedChanged = 5 }

void connectStatus ( QObject * receiver, const char * member )

void disconnectStatus ( QObject * receiver, const char * member = 0 )
 

DESCRIPTION

The QMovie class provides incremental loading of animations or images, signalling as it progresses.

The simplest way to display a QMovie is to use a QLabel and QLabel::setMovie().

A QMovie provides a QPixmap as the framePixmap(); connections can be made via connectResize() and connectUpdate() to receive notification of size and pixmap changes. All decoding is driven by the normal event-processing mechanisms.

The movie begins playing as soon as the QMovie is created (actually, once control returns to the event loop). When the last frame in the movie has been played, it may loop back to the start if such looping is defined in the input source.

QMovie objects are explicitly shared. This means that a QMovie copied from another QMovie will be displaying the same frame at all times. If one shared movie pauses, all pause. To make independent movies, they must be constructed separately.

The set of data formats supported by QMovie is determined by the decoder factories that have been installed; the format of the input is determined as the input is decoded.

The supported formats are MNG (if Qt is configured with MNG support enabled) and GIF (if Qt is configured with GIF support enabled, see qgif.h).

If Qt is configured to support GIF reading, we are required to state that "The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.

Warning: If you are in a country that recognizes software patents and in which Unisys holds a patent on LZW compression and/or decompression and you want to use GIF, Unisys may require you to license that technology. Such countries include Canada, Japan, the USA, France, Germany, Italy and the UK.

GIF support may be removed completely in a future version of Qt. We recommend using the MNG or PNG format.

<center>

[Image Omitted]

</center>

See also QLabel::setMovie(), Graphics Classes, Image Processing Classes, and Multimedia Classes.  

Member Type Documentation

 

QMovie::Status

QMovie::SourceEmpty
QMovie::UnrecognizedFormat
QMovie::Paused
QMovie::EndOfFrame
QMovie::EndOfLoop
QMovie::EndOfMovie
QMovie::SpeedChanged
 

MEMBER FUNCTION DOCUMENTATION

 

QMovie::QMovie ()

Constructs a null QMovie. The only interesting thing to do with such a movie is to assign another movie to it.

See also isNull().  

QMovie::QMovie ( int bufsize )

Constructs a QMovie with an external data source. You should later call pushData() to send incoming animation data to the movie.

The bufsize argument sets the maximum amount of data the movie will transfer from the data source per event loop. The lower this value, the better interleaved the movie playback will be with other event processing, but the slower the overall processing will be.

See also pushData().  

QMovie::QMovie ( QDataSource * src, int bufsize = 1024 )

Constructs a QMovie that reads an image sequence from the given data source, src. The source must be allocated dynamically, because QMovie will take ownership of it and will destroy it when the movie is destroyed. The movie starts playing as soon as event processing continues.

The bufsize argument sets the maximum amount of data the movie will transfer from the data source per event loop. The lower this value, the better interleaved the movie playback will be with other event processing, but the slower the overall processing will be.  

QMovie::QMovie ( const QString & fileName, int bufsize = 1024 )

Constructs a QMovie that reads an image sequence from the file, fileName.

The bufsize argument sets the maximum amount of data the movie will transfer from the data source per event loop. The lower this value, the better interleaved the movie playback will be with other event processing, but the slower the overall processing will be.  

QMovie::QMovie ( QByteArray data, int bufsize = 1024 )

Constructs a QMovie that reads an image sequence from the byte array, data.

The bufsize argument sets the maximum amount of data the movie will transfer from the data source per event loop. The lower this value, the better interleaved the movie playback will be with other event processing, but the slower the overall processing will be.  

QMovie::QMovie ( const QMovie & movie )

Constructs a movie that uses the same data as movie movie. QMovies use explicit sharing, so operations on the copy will affect both.  

QMovie::~QMovie ()

Destroys the QMovie. If this is the last reference to the data of the movie, the data is deallocated.  

const QColor & QMovie::backgroundColor () const

Returns the background color of the movie set by setBackgroundColor().  

void QMovie::connectResize ( QObject * receiver, const char * member )

Connects the receiver's member of type void member(const QSize&) so that it is signalled when the movie changes size.

Note that due to the expl