File: qmovie.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (271 lines) | stat: -rw-r--r-- 17,791 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QMovie Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QMovie Class Reference</h1><br clear="all">
<p>
Incrementally loads an animation or image, signalling as it progresses.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qmovie-h.html">qmovie.h</a>&gt;</code>
<p><a href="qmovie-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#03c65f"><b>QMovie</b></a>()</div>
<li><div class="fn"><a href="#6d06e9"><b>QMovie</b></a>(intbufsize)</div>
<li><div class="fn"><a href="#cbf938"><b>QMovie</b></a>(QDataSource*, intbufsize=1024)</div>
<li><div class="fn"><a href="#3fcab2"><b>QMovie</b></a>(constQString&amp;fileName, intbufsize=1024)</div>
<li><div class="fn"><a href="#2629e3"><b>QMovie</b></a>(QByteArraydata, intbufsize=1024)</div>
<li><div class="fn"><a href="#f65b4d"><b>QMovie</b></a>(constQMovie&amp;)</div>
<li><div class="fn"><a href="#9585a3"><b>~QMovie</b></a>()</div>
<li><div class="fn">QMovie&amp;<a href="#59776f"><b>operator=</b></a>(constQMovie&amp;)</div>
<li><div class="fn">int<a href="#d35d55"><b>pushSpace</b></a>()const</div>
<li><div class="fn">void<a href="#2f9bcc"><b>pushData</b></a>(constuchar*data, intlength)</div>
<li><div class="fn">constQColor&amp;<a href="#375206"><b>backgroundColor</b></a>()const</div>
<li><div class="fn">void<a href="#768d9b"><b>setBackgroundColor</b></a>(constQColor&amp;)</div>
<li><div class="fn">constQRect&amp;<a href="#c1ad59"><b>getValidRect</b></a>()const</div>
<li><div class="fn">constQPixmap&amp;<a href="#76c20a"><b>framePixmap</b></a>()const</div>
<li><div class="fn">constQImage&amp;<a href="#9fef3c"><b>frameImage</b></a>()const</div>
<li><div class="fn">bool<a href="#e86412"><b>isNull</b></a>()const</div>
<li><div class="fn">int<a href="#edaa8c"><b>frameNumber</b></a>()const</div>
<li><div class="fn">int<a href="#df0756"><b>steps</b></a>()const</div>
<li><div class="fn">bool<a href="#6d57e4"><b>paused</b></a>()const</div>
<li><div class="fn">bool<a href="#d88d15"><b>finished</b></a>()const</div>
<li><div class="fn">bool<a href="#3df1b0"><b>running</b></a>()const</div>
<li><div class="fn">void<a href="#5ef5bf"><b>unpause</b></a>()</div>
<li><div class="fn">void<a href="#1d2926"><b>pause</b></a>()</div>
<li><div class="fn">void<a href="#6f3620"><b>step</b></a>()</div>
<li><div class="fn">void<a href="#491a98"><b>step</b></a>(int)</div>
<li><div class="fn">void<a href="#b58068"><b>restart</b></a>()</div>
<li><div class="fn">int<a href="#752b65"><b>speed</b></a>()const</div>
<li><div class="fn">void<a href="#0e019d"><b>setSpeed</b></a>(int)</div>
<li><div class="fn">void<a href="#cb5a00"><b>connectResize</b></a>(QObject*receiver, constchar*member)</div>
<li><div class="fn">void<a href="#01752d"><b>disconnectResize</b></a>(QObject*receiver, constchar*member=0)</div>
<li><div class="fn">void<a href="#49e682"><b>connectUpdate</b></a>(QObject*receiver, constchar*member)</div>
<li><div class="fn">void<a href="#2f93f8"><b>disconnectUpdate</b></a>(QObject*receiver, constchar*member=0)</div>
<li><div class="fn">enum<b>Status</b>{SourceEmpty=-2, UnrecognizedFormat=-1, Paused=1, EndOfFrame=2, EndOfLoop=3, EndOfMovie=4, SpeedChanged=5}</div>
<li><div class="fn">void<a href="#79242a"><b>connectStatus</b></a>(QObject*receiver, constchar*member)</div>
<li><div class="fn">void<a href="#ba4e08"><b>disconnectStatus</b></a>(QObject*receiver, constchar*member=0)</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
Incrementally loads an animation or image, signalling as it progresses.
<p>
A QMovie provides a <a href="qpixmap.html">QPixmap</a> as the <a href="#76c20a">framePixmap</a>(), and connections can
be made via <a href="#cb5a00">connectResize</a>() and <a href="#49e682">connectUpdate</a>() to receive notification
of size and pixmap changes.  All decoding is driven by
the normal event processing mechanisms.  The simplest way to display
a QMovie, is to use a <a href="qlabel.html">QLabel</a> and <a href="qlabel.html#fb7d9d">QLabel::setMovie</a>().
<p>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.
<p>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 <em>independent</em> movies,
they must be constructed separately.
<p>The set of data formats supported by QMovie is determined by the decoder
factories which have been installed, and the format of the input is
determined as the input is decoded.
<p>The supported formats are MNG (if Qt is built with MNG support enabled)
and GIF (if Qt is built with GIF support enabled).  For MNG support, you
need to have installed libmng from
<a href="http://www.libmng.com/">http://www.libmng.com</a>.
<p>Archives of animated GIFs and tools for building them can be found at
<a href="http://dir.yahoo.com/Arts/Visual_Arts/Animation/Computer_Animation/Animated_GIFs/">Yahoo</a>.
<p>We are required to state: The Graphics Interchange Format(c) is the
Copyright property of CompuServe Incorporated. GIF(sm) is a Service
Mark property of CompuServe Incorporated.<p><b>Warning:</b> Unisys has changed its position regarding GIF.  If you are
in a country where Unisys holds a patent on LZW compression and/or
decompression and you want to use GIF, Unisys may require you to
license that technology.  These countries include Canada, Japan, the
USA, France, Germany, Italy and the UK.
<p>GIF support may be removed completely in a future version of Qt.  We
recommend using the MNG or PNG format.
<p><img src="qmovie.png">
<p>See also  <a href="qlabel.html#fb7d9d">QLabel::setMovie</a>().
<p>Examples:
 <a href="movies-main-cpp.html#QMovie">movies/main.cpp</a>

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="03c65f"></a>QMovie::QMovie()</h3>
<p>Constructs a null QMovie.  The only interesting thing to do to such
a movie is to assign another movie to it.
<p>See also  <a href="#e86412">isNull</a>().
<h3 class="fn"><a name="2629e3"></a>QMovie::QMovie(<a href="qbytearray.html">QByteArray</a>data, intbufsize=1024)</h3>
<p>Constructs a QMovie which reads an image sequence from given data.
<h3 class="fn"><a name="cbf938"></a>QMovie::QMovie(<a href="qdatasource.html">QDataSource</a>*src, intbufsize=1024)</h3>
<p>Constructs a QMovie which reads an image sequence from the given
<a href="qdatasource.html">QDataSource</a>.  The source must be allocated dynamically,
as it becomes owned by the QMovie, and will be destroyed
when the movie is destroyed.
The movie starts playing as soon as event processing continues.
<p>The <em>bufsize</em> 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.
<h3 class="fn"><a name="3fcab2"></a>QMovie::QMovie(const<a href="qstring.html">QString</a>&amp;fileName, intbufsize=1024)</h3>
<p>Constructs a QMovie which reads an image sequence from the named file.
<h3 class="fn"><a name="f65b4d"></a>QMovie::QMovie(constQMovie&amp;movie)</h3>
<p>Constructs a movie that uses the same data as another movie.
QMovies use explicit sharing, so operations on the copy will
effect the same operations on the original.
<h3 class="fn"><a name="6d06e9"></a>QMovie::QMovie(intbufsize)</h3>
<p>Constructs a QMovie with an external data source.
You should later call <a href="#2f9bcc">pushData</a>() to send incoming animation data to
the movie.
<p>See also  <a href="#2f9bcc">pushData</a>().
<h3 class="fn"><a name="9585a3"></a>QMovie::~QMovie()</h3>
<p>Destroys the QMovie.  If this is the last reference to the data of the
movie, that will also be destroyed.
<h3 class="fn">const<a href="qcolor.html">QColor</a>&amp;<a name="375206"></a>QMovie::backgroundColor()const</h3>
<p>Returns the background color of the movie set by <a href="#768d9b">setBackgroundColor</a>().
<h3 class="fn">void<a name="cb5a00"></a>QMovie::connectResize(<a href="qobject.html">QObject</a>*receiver, constchar*member)</h3>
<p>Connects the given member, of type <pre> void member(const QSize&amp;)
</pre>
<p>such that it is signalled when the movie changes size.
<p>Note that due to the explicit sharing of QMovie objects, these connections
persist until they are explicitly disconnected with <a href="#01752d">disconnectResize</a>(), or
until <em>every</em> shared copy of the movie is deleted.
<h3 class="fn">void<a name="79242a"></a>QMovie::connectStatus(<a href="qobject.html">QObject</a>*receiver, constchar*member)</h3>
<p>Connects the given member, of type <pre> void member(int)
</pre>
<p>such that it is signalled when the movie changes status.  The status
code are negative for errors and positive for information, and they
are currently:
<p><ul>
<li> <code>QMovie::SourceEmpty</code> - signalled if the input cannot be read.
<li> <code>QMovie::UnrecognizedFormat</code> - signalled if the input data is unrecognized.
<li> <code>QMovie::Paused</code> - signalled when the movie is paused by a call to <a href="#6d57e4">paused</a>(),
or by after <a href="#491a98">stepping</a> pauses.
<li> <code>QMovie::EndOfFrame</code> - signalled at end-of-frame, after any update and Paused signals.
<li> <code>QMovie::EndOfLoop</code> - signalled at end-of-loop, after any update signals,
EndOfFrame, but before EndOfMovie.
<li> <code>QMovie::EndOfMovie</code> - signalled when the movie completes and is not about
to loop.
</ul>
<p>More status messages may be added in the future, so a general test for
error would test for negative.
<p>Note that due to the explicit sharing of QMovie objects, these connections
persist until they are explicitly disconnected with <a href="#ba4e08">disconnectStatus</a>(), or
until <em>every</em> shared copy of the movie is deleted.
<h3 class="fn">void<a name="49e682"></a>QMovie::connectUpdate(<a href="qobject.html">QObject</a>*receiver, constchar*member)</h3>
<p>Connects the given member, of type <pre> void member(const QRect&amp;)
</pre>
<p>such that it is signalled when an area of the <a href="#76c20a">framePixmap</a>() has
changed since the previous frame.
<p>Note that due to the explicit sharing of QMovie objects, these connections
persist until they are explicitly disconnected with <a href="#2f93f8">disconnectUpdate</a>(), or
until <em>every</em> shared copy of the movie is deleted.
<h3 class="fn">void<a name="01752d"></a>QMovie::disconnectResize(<a href="qobject.html">QObject</a>*receiver, constchar*member=0)</h3>
<p>Disconnects the given member, or all members if member is zero,
previously connected by
<a href="#cb5a00">connectResize</a>().
<h3 class="fn">void<a name="ba4e08"></a>QMovie::disconnectStatus(<a href="qobject.html">QObject</a>*receiver, constchar*member=0)</h3>
<p>Disconnects the given member, or all members if member is zero,
previously connected by
<a href="#79242a">connectStatus</a>().
<h3 class="fn">void<a name="2f93f8"></a>QMovie::disconnectUpdate(<a href="qobject.html">QObject</a>*receiver, constchar*member=0)</h3>
<p>Disconnects the given member, or all members if member is zero,
previously connected by
<a href="#49e682">connectUpdate</a>().
<h3 class="fn">bool<a name="d88d15"></a>QMovie::finished()const</h3>
<p>Returns TRUE if the image is no longer playing - this happens when all
loops of all frames is complete.
<h3 class="fn">const<a href="qimage.html">QImage</a>&amp;<a name="9fef3c"></a>QMovie::frameImage()const</h3>
<p>Returns the current frame of the movie, as a <a href="qimage.html">QImage</a>.
It is not generally useful to keep a copy of this image.
Also note that you must not call this function if the
movie is <a href="#d88d15">finished</a>(), as the image is not them available.
<p>See also  <a href="#76c20a">framePixmap</a>().
<h3 class="fn">int<a name="edaa8c"></a>QMovie::frameNumber()const</h3>
<p>Returns the number of times EndOfFrame has been emitted since the
start of the current loop of the movie.  Thus, before
any EndOfFrame has been emitted, the value will be 0,
within slots processing the first signal, frameNumber() will be 1, and
so on.
<h3 class="fn">const<a href="qpixmap.html">QPixmap</a>&amp;<a name="76c20a"></a>QMovie::framePixmap()const</h3>
<p>Returns the current frame of the movie, as a <a href="qpixmap.html">QPixmap</a>.
It is not generally useful to
keep a copy of this pixmap.  Better to keep a copy of the QMovie and
get the framePixmap() only when needed for drawing.
<p>See also  <a href="#9fef3c">frameImage</a>().
<h3 class="fn">const<a href="qrect.html">QRect</a>&amp;<a name="c1ad59"></a>QMovie::getValidRect()const</h3>
<p>Returns the area of the pixmap for which pixels have been generated.
<h3 class="fn">bool<a name="e86412"></a>QMovie::isNull()const</h3>
<p>Returns TRUE if the movie is null.
<h3 class="fn">QMovie&amp;<a name="59776f"></a>QMovie::operator=(constQMovie&amp;movie)</h3>
<p>Makes this movie use the same data as another movie.
QMovies use explicit sharing.
<h3 class="fn">void<a name="1d2926"></a>QMovie::pause()</h3>
<p>Pauses the progress of the animation.
<p>See also  <a href="#5ef5bf">unpause</a>().
<h3 class="fn">bool<a name="6d57e4"></a>QMovie::paused()const</h3>
<p>Returns TRUE if the image is paused.
<h3 class="fn">void<a name="2f9bcc"></a>QMovie::pushData(constuchar*data, intlength)</h3>
<p>Pushes <em>length</em> bytes from <em>data</em> into the movie.  <em>length</em> must
be no more than the amount returned by <a href="#d35d55">pushSpace</a>() since the previous
call to pushData().
<h3 class="fn">int<a name="d35d55"></a>QMovie::pushSpace()const</h3>
<p>Returns the maximum amount of data that can currently be pushed
into the movie by a call to <a href="#2f9bcc">pushData</a>().  This is affected by the
initial buffer size, but varies as the movie plays and data is consumed.
<h3 class="fn">void<a name="b58068"></a>QMovie::restart()</h3>
<p>Rewinds the movie to the beginning.  If the movie has not been paused,
it begins playing again.
<h3 class="fn">bool<a name="3df1b0"></a>QMovie::running()const</h3>
<p>Returns TRUE if the image is not single-stepping, not paused,
and not finished.
<h3 class="fn">void<a name="768d9b"></a>QMovie::setBackgroundColor(const<a href="qcolor.html">QColor</a>&amp;c)</h3>
<p>Set the background color of the pixmap.  If the background color
isValid(), the pixmap will never have a mask, as the background
color will be used in transparent regions of the image.
<p>See also  <a href="#375206">backgroundColor</a>().
<h3 class="fn">void<a name="0e019d"></a>QMovie::setSpeed(intpercent)</h3>
<p>Sets the speed-up factor of the movie.  This is a percentage of the
speed dictated by the input data format.  The default is 100 percent.
<h3 class="fn">int<a name="752b65"></a>QMovie::speed()const</h3>
<p>Returns the speed-up factor of the movie.  The default is 100 percent.
<p>See also  <a href="#0e019d">setSpeed</a>().
<h3 class="fn">void<a name="6f3620"></a>QMovie::step()</h3>
<p>Steps forward 1 frame, then pauses.
<h3 class="fn">void<a name="491a98"></a>QMovie::step(intsteps)</h3>
<p>Steps forward, showing the given number of frames, then pauses.
<h3 class="fn">int<a name="df0756"></a>QMovie::steps()const</h3>
<p>Returns the number of steps remaining after a call to <a href="#491a98">step</a>(), 0 if paused,
or a negative value if the movie is running normally or is finished.
<h3 class="fn">void<a name="5ef5bf"></a>QMovie::unpause()</h3>
<p>Unpauses the progress of the animation.
<p>See also  <a href="#1d2926">pause</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>