1QMovie(3qt) QMovie(3qt)
2
3
4
6 QMovie - Incremental loading of animations or images, signalling as it
7 progresses
8
10 #include <qmovie.h>
11
12 Public Members
13 QMovie ()
14 QMovie ( int bufsize )
15 QMovie ( QDataSource * src, int bufsize = 1024 )
16 QMovie ( const QString & fileName, int bufsize = 1024 )
17 QMovie ( QByteArray data, int bufsize = 1024 )
18 QMovie ( const QMovie & movie )
19 ~QMovie ()
20 QMovie & operator= ( const QMovie & movie )
21 int pushSpace () const
22 void pushData ( const uchar * data, int length )
23 const QColor & backgroundColor () const
24 void setBackgroundColor ( const QColor & c )
25 const QRect & getValidRect () const
26 const QPixmap & framePixmap () const
27 const QImage & frameImage () const
28 bool isNull () const
29 int frameNumber () const
30 int steps () const
31 bool paused () const
32 bool finished () const
33 bool running () const
34 void unpause ()
35 void pause ()
36 void step ()
37 void step ( int steps )
38 void restart ()
39 int speed () const
40 void setSpeed ( int percent )
41 void connectResize ( QObject * receiver, const char * member )
42 void disconnectResize ( QObject * receiver, const char * member = 0 )
43 void connectUpdate ( QObject * receiver, const char * member )
44 void disconnectUpdate ( QObject * receiver, const char * member = 0 )
45 enum Status { SourceEmpty = -2, UnrecognizedFormat = -1, Paused = 1,
46 EndOfFrame = 2, EndOfLoop = 3, EndOfMovie = 4, SpeedChanged = 5 }
47 void connectStatus ( QObject * receiver, const char * member )
48 void disconnectStatus ( QObject * receiver, const char * member = 0 )
49
51 The QMovie class provides incremental loading of animations or images,
52 signalling as it progresses.
53
54 The simplest way to display a QMovie is to use a QLabel and
55 QLabel::setMovie().
56
57 A QMovie provides a QPixmap as the framePixmap(); connections can be
58 made via connectResize() and connectUpdate() to receive notification of
59 size and pixmap changes. All decoding is driven by the normal event-
60 processing mechanisms.
61
62 The movie begins playing as soon as the QMovie is created (actually,
63 once control returns to the event loop). When the last frame in the
64 movie has been played, it may loop back to the start if such looping is
65 defined in the input source.
66
67 QMovie objects are explicitly shared. This means that a QMovie copied
68 from another QMovie will be displaying the same frame at all times. If
69 one shared movie pauses, all pause. To make independent movies, they
70 must be constructed separately.
71
72 The set of data formats supported by QMovie is determined by the
73 decoder factories that have been installed; the format of the input is
74 determined as the input is decoded.
75
76 The supported formats are MNG (if Qt is configured with MNG support
77 enabled) and GIF (if Qt is configured with GIF support enabled, see
78 qgif.h).
79
80 If Qt is configured to support GIF reading, we are required to state
81 that "The Graphics Interchange Format(c) is the Copyright property of
82 CompuServe Incorporated. GIF(sm) is a Service Mark property of
83 CompuServe Incorporated.
84
85 Warning: If you are in a country that recognizes software patents and
86 in which Unisys holds a patent on LZW compression and/or decompression
87 and you want to use GIF, Unisys may require you to license that
88 technology. Such countries include Canada, Japan, the USA, France,
89 Germany, Italy and the UK.
90
91 GIF support may be removed completely in a future version of Qt. We
92 recommend using the MNG or PNG format.
93
94 <center>
95 [Image Omitted]
96
97 </center>
98
99 See also QLabel::setMovie(), Graphics Classes, Image Processing
100 Classes, and Multimedia Classes.
101
102 Member Type Documentation
104 QMovie::SourceEmpty
105
106 QMovie::UnrecognizedFormat
107
108 QMovie::Paused
109
110 QMovie::EndOfFrame
111
112 QMovie::EndOfLoop
113
114 QMovie::EndOfMovie
115
116 QMovie::SpeedChanged
117
120 Constructs a null QMovie. The only interesting thing to do with such a
121 movie is to assign another movie to it.
122
123 See also isNull().
124
126 Constructs a QMovie with an external data source. You should later call
127 pushData() to send incoming animation data to the movie.
128
129 The bufsize argument sets the maximum amount of data the movie will
130 transfer from the data source per event loop. The lower this value, the
131 better interleaved the movie playback will be with other event
132 processing, but the slower the overall processing will be.
133
134 See also pushData().
135
137 Constructs a QMovie that reads an image sequence from the given data
138 source, src. The source must be allocated dynamically, because QMovie
139 will take ownership of it and will destroy it when the movie is
140 destroyed. The movie starts playing as soon as event processing
141 continues.
142
143 The bufsize argument sets the maximum amount of data the movie will
144 transfer from the data source per event loop. The lower this value, the
145 better interleaved the movie playback will be with other event
146 processing, but the slower the overall processing will be.
147
149 Constructs a QMovie that reads an image sequence from the file,
150 fileName.
151
152 The bufsize argument sets the maximum amount of data the movie will
153 transfer from the data source per event loop. The lower this value, the
154 better interleaved the movie playback will be with other event
155 processing, but the slower the overall processing will be.
156
158 Constructs a QMovie that reads an image sequence from the byte array,
159 data.
160
161 The bufsize argument sets the maximum amount of data the movie will
162 transfer from the data source per event loop. The lower this value, the
163 better interleaved the movie playback will be with other event
164 processing, but the slower the overall processing will be.
165
167 Constructs a movie that uses the same data as movie movie. QMovies use
168 explicit sharing, so operations on the copy will affect both.
169
171 Destroys the QMovie. If this is the last reference to the data of the
172 movie, the data is deallocated.
173
175 Returns the background color of the movie set by setBackgroundColor().
176
178 Connects the receiver's member of type void member(const QSize&) so
179 that it is signalled when the movie changes size.
180
181 Note that due to the explicit sharing of QMovie objects, these
182 connections persist until they are explicitly disconnected with
183 disconnectResize() or until every shared copy of the movie is deleted.
184
185 Example: movies/main.cpp.
186
188 Connects the receiver's member, of type void member(int) so that it is
189 signalled when the movie changes status. The status codes are negative
190 for errors and positive for information.
191
192 <center>.nf
193
194 </center>
195
196 More status messages may be added in the future, so a general test for
197 errors would test for negative.
198
199 Note that due to the explicit sharing of QMovie objects, these
200 connections persist until they are explicitly disconnected with
201 disconnectStatus() or until every shared copy of the movie is deleted.
202
203 Example: movies/main.cpp.
204
206 Connects the receiver's member of type void member(const QRect&) so
207 that it is signalled when an area of the framePixmap() has changed
208 since the previous frame.
209
210 Note that due to the explicit sharing of QMovie objects, these
211 connections persist until they are explicitly disconnected with
212 disconnectUpdate() or until every shared copy of the movie is deleted.
213
214 Example: movies/main.cpp.
215
217 Disconnects the receiver's member (or all members if member is zero)
218 that were previously connected by connectResize().
219
221 Disconnects the receiver's member (or all members if member is zero)
222 that were previously connected by connectStatus().
223
225 Disconnects the receiver's member (or all members if \q member is zero)
226 that were previously connected by connectUpdate().
227
229 Returns TRUE if the image is no longer playing: this happens when all
230 loops of all frames are complete; otherwise returns FALSE.
231
232 Example: movies/main.cpp.
233
235 Returns the current frame of the movie, as a QImage. It is not
236 generally useful to keep a copy of this image. Also note that you must
237 not call this function if the movie is finished(), since by then the
238 image will not be available.
239
240 See also framePixmap().
241
243 Returns the number of times EndOfFrame has been emitted since the start
244 of the current loop of the movie. Thus, before any EndOfFrame has been
245 emitted the value will be 0; within slots processing the first signal,
246 frameNumber() will be 1, and so on.
247
249 Returns the current frame of the movie, as a QPixmap. It is not
250 generally useful to keep a copy of this pixmap. It is better to keep a
251 copy of the QMovie and get the framePixmap() only when needed for
252 drawing.
253
254 See also frameImage().
255
256 Example: movies/main.cpp.
257
259 Returns the area of the pixmap for which pixels have been generated.
260
262 Returns TRUE if the movie is null; otherwise returns FALSE.
263
265 Makes this movie use the same data as movie movie. QMovies use explicit
266 sharing.
267
269 Pauses the progress of the animation.
270
271 See also unpause().
272
273 Example: movies/main.cpp.
274
276 Returns TRUE if the image is paused; otherwise returns FALSE.
277
278 Example: movies/main.cpp.
279
281 Pushes length bytes from data into the movie. length must be no more
282 than the amount returned by pushSpace() since the previous call to
283 pushData().
284
286 Returns the maximum amount of data that can currently be pushed into
287 the movie by a call to pushData(). This is affected by the initial
288 buffer size, but varies as the movie plays and data is consumed.
289
291 Rewinds the movie to the beginning. If the movie has not been paused,
292 it begins playing again.
293
294 Example: movies/main.cpp.
295
297 Returns TRUE if the image is not single-stepping, not paused, and not
298 finished; otherwise returns FALSE.
299
301 Sets the background color of the pixmap to c. If the background color
302 isValid(), the pixmap will never have a mask because the background
303 color will be used in transparent regions of the image.
304
305 See also backgroundColor().
306
308 Sets the movie's play speed as a percentage, to percent. This is a
309 percentage of the speed dictated by the input data format. The default
310 is 100 percent.
311
313 Returns the movie's play speed as a percentage. The default is 100
314 percent.
315
316 See also setSpeed().
317
319 Steps forward 1 frame and then pauses.
320
321 Example: movies/main.cpp.
322
324 This is an overloaded member function, provided for convenience. It
325 behaves essentially like the above function.
326
327 Steps forward, showing steps frames, and then pauses.
328
330 Returns the number of steps remaining after a call to step(). If the
331 movie is paused, steps() returns 0. If it's running normally or is
332 finished, steps() returns a negative number.
333
334 Example: movies/main.cpp.
335
337 Unpauses the progress of the animation.
338
339 See also pause().
340
341 Example: movies/main.cpp.
342
343
345 http://doc.trolltech.com/qmovie.html
346 http://www.trolltech.com/faq/tech.html
347
349 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
350 license file included in the distribution for a complete license
351 statement.
352
354 Generated automatically from the source code.
355
357 If you find a bug in Qt, please report it as described in
358 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
359 help you. Thank you.
360
361 The definitive Qt documentation is provided in HTML format; it is
362 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
363 web browser. This man page is provided as a convenience for those users
364 who prefer man pages, although this format is not officially supported
365 by Trolltech.
366
367 If you find errors in this manual page, please report them to qt-
368 bugs@trolltech.com. Please include the name of the manual page
369 (qmovie.3qt) and the Qt version (3.3.8).
370
371
372
373Trolltech AS 2 February 2007 QMovie(3qt)