PageRenderTime 52ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/qt-everywhere-opensource-src-4.8.2/doc/html/qmovie.html

#
HTML | 408 lines | 321 code | 1 blank | 86 comment | 0 complexity | a8a72b7c67b8be2128f9084397deec90 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-4.0, LGPL-3.0, GPL-2.0, LGPL-2.0, LGPL-2.1, GPL-3.0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <!-- qmovie.cpp -->
  7. <title>Qt 4.8: QMovie Class Reference</title>
  8. <link rel="stylesheet" type="text/css" href="style/offline.css" />
  9. </head>
  10. <body>
  11. <div class="header" id="qtdocheader">
  12. <div class="content">
  13. <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  14. </div>
  15. <div class="breadcrumb toolblock">
  16. <ul>
  17. <li class="first"><a href="index.html">Home</a></li>
  18. <!-- Breadcrumbs go here -->
  19. <li><a href="modules.html">Modules</a></li>
  20. <li><a href="qtgui.html">QtGui</a></li>
  21. <li>QMovie</li>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="content mainContent">
  26. <div class="toc">
  27. <h3><a name="toc">Contents</a></h3>
  28. <ul>
  29. <li class="level1"><a href="#public-types">Public Types</a></li>
  30. <li class="level1"><a href="#properties">Properties</a></li>
  31. <li class="level1"><a href="#public-functions">Public Functions</a></li>
  32. <li class="level1"><a href="#public-slots">Public Slots</a></li>
  33. <li class="level1"><a href="#signals">Signals</a></li>
  34. <li class="level1"><a href="#static-public-members">Static Public Members</a></li>
  35. <li class="level1"><a href="#details">Detailed Description</a></li>
  36. </ul>
  37. </div>
  38. <h1 class="title">QMovie Class Reference</h1>
  39. <!-- $$$QMovie-brief -->
  40. <p>The QMovie class is a convenience class for playing movies with <a href="qimagereader.html">QImageReader</a>. <a href="#details">More...</a></p>
  41. <!-- @@@QMovie -->
  42. <pre class="cpp"> <span class="preprocessor">#include &lt;QMovie&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
  43. <ul>
  44. <li><a href="qmovie-members.html">List of all members, including inherited members</a></li>
  45. <li><a href="qmovie-qt3.html">Qt 3 support members</a></li>
  46. </ul>
  47. <a name="public-types"></a>
  48. <h2>Public Types</h2>
  49. <table class="alignedsummary">
  50. <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#CacheMode-enum">CacheMode</a></b> { CacheNone, CacheAll }</td></tr>
  51. <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#MovieState-enum">MovieState</a></b> { NotRunning, Paused, Running }</td></tr>
  52. </table>
  53. <a name="properties"></a>
  54. <h2>Properties</h2>
  55. <ul>
  56. <li class="fn"><b><a href="qmovie.html#cacheMode-prop">cacheMode</a></b> : CacheMode</li>
  57. <li class="fn"><b><a href="qmovie.html#speed-prop">speed</a></b> : int</li>
  58. </ul>
  59. <ul>
  60. <li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
  61. </ul>
  62. <a name="public-functions"></a>
  63. <h2>Public Functions</h2>
  64. <table class="alignedsummary">
  65. <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#QMovie">QMovie</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
  66. <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#QMovie-2">QMovie</a></b> ( QIODevice * <i>device</i>, const QByteArray &amp; <i>format</i> = QByteArray(), QObject * <i>parent</i> = 0 )</td></tr>
  67. <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#QMovie-3">QMovie</a></b> ( const QString &amp; <i>fileName</i>, const QByteArray &amp; <i>format</i> = QByteArray(), QObject * <i>parent</i> = 0 )</td></tr>
  68. <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#dtor.QMovie">~QMovie</a></b> ()</td></tr>
  69. <tr><td class="memItemLeft rightAlign topAlign"> QColor </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#backgroundColor">backgroundColor</a></b> () const</td></tr>
  70. <tr><td class="memItemLeft rightAlign topAlign"> CacheMode </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#cacheMode-prop">cacheMode</a></b> () const</td></tr>
  71. <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#currentFrameNumber">currentFrameNumber</a></b> () const</td></tr>
  72. <tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#currentImage">currentImage</a></b> () const</td></tr>
  73. <tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#currentPixmap">currentPixmap</a></b> () const</td></tr>
  74. <tr><td class="memItemLeft rightAlign topAlign"> QIODevice * </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#device">device</a></b> () const</td></tr>
  75. <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#fileName">fileName</a></b> () const</td></tr>
  76. <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#format">format</a></b> () const</td></tr>
  77. <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#frameCount">frameCount</a></b> () const</td></tr>
  78. <tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#frameRect">frameRect</a></b> () const</td></tr>
  79. <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#isValid">isValid</a></b> () const</td></tr>
  80. <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#jumpToFrame">jumpToFrame</a></b> ( int <i>frameNumber</i> )</td></tr>
  81. <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#loopCount">loopCount</a></b> () const</td></tr>
  82. <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#nextFrameDelay">nextFrameDelay</a></b> () const</td></tr>
  83. <tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#scaledSize">scaledSize</a></b> ()</td></tr>
  84. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setBackgroundColor">setBackgroundColor</a></b> ( const QColor &amp; <i>color</i> )</td></tr>
  85. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#cacheMode-prop">setCacheMode</a></b> ( CacheMode <i>mode</i> )</td></tr>
  86. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setDevice">setDevice</a></b> ( QIODevice * <i>device</i> )</td></tr>
  87. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setFileName">setFileName</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
  88. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setFormat">setFormat</a></b> ( const QByteArray &amp; <i>format</i> )</td></tr>
  89. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setScaledSize">setScaledSize</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
  90. <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#speed-prop">speed</a></b> () const</td></tr>
  91. <tr><td class="memItemLeft rightAlign topAlign"> MovieState </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#state">state</a></b> () const</td></tr>
  92. </table>
  93. <ul>
  94. <li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
  95. </ul>
  96. <a name="public-slots"></a>
  97. <h2>Public Slots</h2>
  98. <table class="alignedsummary">
  99. <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#jumpToNextFrame">jumpToNextFrame</a></b> ()</td></tr>
  100. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#setPaused">setPaused</a></b> ( bool <i>paused</i> )</td></tr>
  101. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#speed-prop">setSpeed</a></b> ( int <i>percentSpeed</i> )</td></tr>
  102. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#start">start</a></b> ()</td></tr>
  103. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#stop">stop</a></b> ()</td></tr>
  104. </table>
  105. <ul>
  106. <li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
  107. </ul>
  108. <a name="signals"></a>
  109. <h2>Signals</h2>
  110. <table class="alignedsummary">
  111. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#error">error</a></b> ( QImageReader::ImageReaderError <i>error</i> )</td></tr>
  112. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#finished">finished</a></b> ()</td></tr>
  113. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#frameChanged">frameChanged</a></b> ( int <i>frameNumber</i> )</td></tr>
  114. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#resized">resized</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
  115. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#started">started</a></b> ()</td></tr>
  116. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#stateChanged">stateChanged</a></b> ( QMovie::MovieState <i>state</i> )</td></tr>
  117. <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#updated">updated</a></b> ( const QRect &amp; <i>rect</i> )</td></tr>
  118. </table>
  119. <ul>
  120. <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
  121. </ul>
  122. <a name="static-public-members"></a>
  123. <h2>Static Public Members</h2>
  124. <table class="alignedsummary">
  125. <tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QByteArray&gt; </td><td class="memItemRight bottomAlign"><b><a href="qmovie.html#supportedFormats">supportedFormats</a></b> ()</td></tr>
  126. </table>
  127. <ul>
  128. <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
  129. </ul>
  130. <h3>Additional Inherited Members</h3>
  131. <ul>
  132. <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
  133. </ul>
  134. <a name="details"></a>
  135. <!-- $$$QMovie-description -->
  136. <div class="descr">
  137. <h2>Detailed Description</h2>
  138. <p>The QMovie class is a convenience class for playing movies with <a href="qimagereader.html">QImageReader</a>.</p>
  139. <p>This class is used to show simple animations without sound. If you want to display video and media content, use the <a href="phonon-module.html">Phonon</a> multimedia framework instead.</p>
  140. <p>First, create a QMovie object by passing either the name of a file or a pointer to a <a href="qiodevice.html">QIODevice</a> containing an animated image format to QMovie's constructor. You can call <a href="qmovie.html#isValid">isValid</a>() to check if the image data is valid, before starting the movie. To start the movie, call <a href="qmovie.html#start">start</a>(). QMovie will enter <a href="qmovie.html#MovieState-enum">Running</a> state, and emit <a href="qmovie.html#started">started</a>() and <a href="qmovie.html#stateChanged">stateChanged</a>(). To get the current state of the movie, call <a href="qmovie.html#state">state</a>().</p>
  141. <p>To display the movie in your application, you can pass your QMovie object to <a href="qlabel.html#setMovie">QLabel::setMovie</a>(). Example:</p>
  142. <pre class="cpp"> <span class="type"><a href="qlabel.html">QLabel</a></span> label;
  143. <span class="type">QMovie</span> <span class="operator">*</span>movie <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QMovie</span>(<span class="string">&quot;animations/fire.gif&quot;</span>);
  144. label<span class="operator">.</span>setMovie(movie);
  145. movie<span class="operator">-</span><span class="operator">&gt;</span><a href="qmovie.html#start">start</a>();</pre>
  146. <p>Whenever a new frame is available in the movie, QMovie will emit <a href="qmovie.html#updated">updated</a>(). If the size of the frame changes, <a href="qmovie.html#resized">resized</a>() is emitted. You can call <a href="qmovie.html#currentImage">currentImage</a>() or <a href="qmovie.html#currentPixmap">currentPixmap</a>() to get a copy of the current frame. When the movie is done, QMovie emits <a href="qmovie.html#finished">finished</a>(). If any error occurs during playback (i.e, the image file is corrupt), QMovie will emit <a href="qmovie.html#error">error</a>().</p>
  147. <p>You can control the speed of the movie playback by calling <a href="qmovie.html#speed-prop">setSpeed</a>(), which takes the percentage of the original speed as an argument. Pause the movie by calling setPaused(true). QMovie will then enter <a href="qmovie.html#MovieState-enum">Paused</a> state and emit <a href="qmovie.html#stateChanged">stateChanged</a>(). If you call setPaused(false), QMovie will reenter <a href="qmovie.html#MovieState-enum">Running</a> state and start the movie again. To stop the movie, call <a href="qmovie.html#stop">stop</a>().</p>
  148. <p>Certain animation formats allow you to set the background color. You can call <a href="qmovie.html#setBackgroundColor">setBackgroundColor</a>() to set the color, or <a href="qmovie.html#backgroundColor">backgroundColor</a>() to retrieve the current background color.</p>
  149. <p><a href="qmovie.html#currentFrameNumber">currentFrameNumber</a>() returns the sequence number of the current frame. The first frame in the animation has the sequence number 0. <a href="qmovie.html#frameCount">frameCount</a>() returns the total number of frames in the animation, if the image format supports this. You can call <a href="qmovie.html#loopCount">loopCount</a>() to get the number of times the movie should loop before finishing. <a href="qmovie.html#nextFrameDelay">nextFrameDelay</a>() returns the number of milliseconds the current frame should be displayed.</p>
  150. <p>QMovie can be instructed to cache frames of an animation by calling <a href="qmovie.html#cacheMode-prop">setCacheMode</a>().</p>
  151. <p>Call <a href="qmovie.html#supportedFormats">supportedFormats</a>() for a list of formats that QMovie supports.</p>
  152. </div>
  153. <p><b>See also </b><a href="qlabel.html">QLabel</a>, <a href="qimagereader.html">QImageReader</a>, and <a href="widgets-movie.html">Movie Example</a>.</p>
  154. <!-- @@@QMovie -->
  155. <div class="types">
  156. <h2>Member Type Documentation</h2>
  157. <!-- $$$CacheMode$$$CacheNone$$$CacheAll -->
  158. <h3 class="fn"><a name="CacheMode-enum"></a>enum QMovie::<span class="name">CacheMode</span></h3>
  159. <p>This enum describes the different cache modes of <a href="qmovie.html">QMovie</a>.</p>
  160. <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
  161. <tr><td class="topAlign"><tt>QMovie::CacheNone</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No frames are cached (the default).</td></tr>
  162. <tr><td class="topAlign"><tt>QMovie::CacheAll</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">All frames are cached.</td></tr>
  163. </table>
  164. <!-- @@@CacheMode -->
  165. <!-- $$$MovieState$$$NotRunning$$$Paused$$$Running -->
  166. <h3 class="fn"><a name="MovieState-enum"></a>enum QMovie::<span class="name">MovieState</span></h3>
  167. <p>This enum describes the different states of <a href="qmovie.html">QMovie</a>.</p>
  168. <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
  169. <tr><td class="topAlign"><tt>QMovie::NotRunning</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The movie is not running. This is <a href="qmovie.html">QMovie</a>'s initial state, and the state it enters after <a href="qmovie.html#stop">stop</a>() has been called or the movie is finished.</td></tr>
  170. <tr><td class="topAlign"><tt>QMovie::Paused</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The movie is paused, and <a href="qmovie.html">QMovie</a> stops emitting <a href="qmovie.html#updated">updated</a>() or <a href="qmovie.html#resized">resized</a>(). This state is entered after calling <a href="qmovie-qt3.html#pause" class="compat">pause</a>() or setPaused(true). The current frame number it kept, and the movie will continue with the next frame when <a href="qmovie-qt3.html#unpause" class="compat">unpause</a>() or setPaused(false) is called.</td></tr>
  171. <tr><td class="topAlign"><tt>QMovie::Running</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The movie is running.</td></tr>
  172. </table>
  173. <!-- @@@MovieState -->
  174. </div>
  175. <div class="prop">
  176. <h2>Property Documentation</h2>
  177. <!-- $$$cacheMode-prop$$$cacheMode$$$setCacheModeCacheMode -->
  178. <h3 class="fn"><a name="cacheMode-prop"></a><span class="name">cacheMode</span> : <span class="type"><a href="qmovie.html#CacheMode-enum">CacheMode</a></span></h3>
  179. <p>This property holds the movie's cache mode.</p>
  180. <p>Caching frames can be useful when the underlying animation format handler that <a href="qmovie.html">QMovie</a> relies on to decode the animation data does not support jumping to particular frames in the animation, or even &quot;rewinding&quot; the animation to the beginning (for looping). Furthermore, if the image data comes from a sequential device, it is not possible for the underlying animation handler to seek back to frames whose data has already been read (making looping altogether impossible).</p>
  181. <p>To aid in such situations, a <a href="qmovie.html">QMovie</a> object can be instructed to cache the frames, at the added memory cost of keeping the frames in memory for the lifetime of the object.</p>
  182. <p>By default, this property is set to <a href="qmovie.html#CacheMode-enum">CacheNone</a>.</p>
  183. <p><b>Access functions:</b></p>
  184. <table class="alignedsummary">
  185. <tr><td class="memItemLeft topAlign rightAlign"> CacheMode </td><td class="memItemRight bottomAlign"><span class="name"><b>cacheMode</b></span> () const</td></tr>
  186. <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCacheMode</b></span> ( CacheMode <i>mode</i> )</td></tr>
  187. </table>
  188. <p><b>See also </b><a href="qmovie.html#CacheMode-enum">QMovie::CacheMode</a>.</p>
  189. <!-- @@@cacheMode -->
  190. <!-- $$$speed-prop$$$speed$$$setSpeedint -->
  191. <h3 class="fn"><a name="speed-prop"></a><span class="name">speed</span> : <span class="type">int</span></h3>
  192. <p>This property holds the movie's speed.</p>
  193. <p>The speed is measured in percentage of the original movie speed. The default speed is 100%. Example:</p>
  194. <pre class="cpp"> <span class="type"><a href="qmovie.html">QMovie</a></span> movie(<span class="string">&quot;racecar.gif&quot;</span>);
  195. movie<span class="operator">.</span>setSpeed(<span class="number">200</span>); <span class="comment">// 2x speed</span></pre>
  196. <p><b>Access functions:</b></p>
  197. <table class="alignedsummary">
  198. <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>speed</b></span> () const</td></tr>
  199. <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSpeed</b></span> ( int <i>percentSpeed</i> )</td></tr>
  200. </table>
  201. <!-- @@@speed -->
  202. </div>
  203. <div class="func">
  204. <h2>Member Function Documentation</h2>
  205. <!-- $$$QMovie[overload1]$$$QMovieQObject* -->
  206. <h3 class="fn"><a name="QMovie"></a>QMovie::<span class="name">QMovie</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
  207. <p>Constructs a <a href="qmovie.html">QMovie</a> object, passing the <i>parent</i> object to <a href="qobject.html">QObject</a>'s constructor.</p>
  208. <p><b>See also </b><a href="qmovie.html#setFileName">setFileName</a>(), <a href="qmovie.html#setDevice">setDevice</a>(), and <a href="qmovie.html#setFormat">setFormat</a>().</p>
  209. <!-- @@@QMovie -->
  210. <!-- $$$QMovie$$$QMovieQIODevice*constQByteArray&QObject* -->
  211. <h3 class="fn"><a name="QMovie-2"></a>QMovie::<span class="name">QMovie</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>format</i> = QByteArray(), <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
  212. <p>Constructs a <a href="qmovie.html">QMovie</a> object. <a href="qmovie.html">QMovie</a> will use read image data from <i>device</i>, which it assumes is open and readable. If <i>format</i> is not empty, <a href="qmovie.html">QMovie</a> will use the image format <i>format</i> for decoding the image data. Otherwise, <a href="qmovie.html">QMovie</a> will attempt to guess the format.</p>
  213. <p>The <i>parent</i> object is passed to <a href="qobject.html">QObject</a>'s constructor.</p>
  214. <!-- @@@QMovie -->
  215. <!-- $$$QMovie$$$QMovieconstQString&constQByteArray&QObject* -->
  216. <h3 class="fn"><a name="QMovie-3"></a>QMovie::<span class="name">QMovie</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>format</i> = QByteArray(), <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
  217. <p>Constructs a <a href="qmovie.html">QMovie</a> object. <a href="qmovie.html">QMovie</a> will use read image data from <i>fileName</i>. If <i>format</i> is not empty, <a href="qmovie.html">QMovie</a> will use the image format <i>format</i> for decoding the image data. Otherwise, <a href="qmovie.html">QMovie</a> will attempt to guess the format.</p>
  218. <p>The <i>parent</i> object is passed to <a href="qobject.html">QObject</a>'s constructor.</p>
  219. <!-- @@@QMovie -->
  220. <!-- $$$~QMovie[overload1]$$$~QMovie -->
  221. <h3 class="fn"><a name="dtor.QMovie"></a>QMovie::<span class="name">~QMovie</span> ()</h3>
  222. <p>Destructs the <a href="qmovie.html">QMovie</a> object.</p>
  223. <!-- @@@~QMovie -->
  224. <!-- $$$backgroundColor[overload1]$$$backgroundColor -->
  225. <h3 class="fn"><a name="backgroundColor"></a><span class="type"><a href="qcolor.html">QColor</a></span> QMovie::<span class="name">backgroundColor</span> () const</h3>
  226. <p>Returns the background color of the movie. If no background color has been assigned, an invalid <a href="qcolor.html">QColor</a> is returned.</p>
  227. <p><b>See also </b><a href="qmovie.html#setBackgroundColor">setBackgroundColor</a>().</p>
  228. <!-- @@@backgroundColor -->
  229. <!-- $$$currentFrameNumber[overload1]$$$currentFrameNumber -->
  230. <h3 class="fn"><a name="currentFrameNumber"></a><span class="type">int</span> QMovie::<span class="name">currentFrameNumber</span> () const</h3>
  231. <p>Returns the sequence number of the current frame. The number of the first frame in the movie is 0.</p>
  232. <!-- @@@currentFrameNumber -->
  233. <!-- $$$currentImage[overload1]$$$currentImage -->
  234. <h3 class="fn"><a name="currentImage"></a><span class="type"><a href="qimage.html">QImage</a></span> QMovie::<span class="name">currentImage</span> () const</h3>
  235. <p>Returns the current frame as a <a href="qimage.html">QImage</a>.</p>
  236. <p><b>See also </b><a href="qmovie.html#currentPixmap">currentPixmap</a>() and <a href="qmovie.html#updated">updated</a>().</p>
  237. <!-- @@@currentImage -->
  238. <!-- $$$currentPixmap[overload1]$$$currentPixmap -->
  239. <h3 class="fn"><a name="currentPixmap"></a><span class="type"><a href="qpixmap.html">QPixmap</a></span> QMovie::<span class="name">currentPixmap</span> () const</h3>
  240. <p>Returns the current frame as a <a href="qpixmap.html">QPixmap</a>.</p>
  241. <p><b>See also </b><a href="qmovie.html#currentImage">currentImage</a>() and <a href="qmovie.html#updated">updated</a>().</p>
  242. <!-- @@@currentPixmap -->
  243. <!-- $$$device[overload1]$$$device -->
  244. <h3 class="fn"><a name="device"></a><span class="type"><a href="qiodevice.html">QIODevice</a></span> * QMovie::<span class="name">device</span> () const</h3>
  245. <p>Returns the device <a href="qmovie.html">QMovie</a> reads image data from. If no device has currently been assigned, 0 is returned.</p>
  246. <p><b>See also </b><a href="qmovie.html#setDevice">setDevice</a>() and <a href="qmovie.html#fileName">fileName</a>().</p>
  247. <!-- @@@device -->
  248. <!-- $$$error[overload1]$$$errorQImageReader::ImageReaderError -->
  249. <h3 class="fn"><a name="error"></a><span class="type">void</span> QMovie::<span class="name">error</span> ( <span class="type"><a href="qimagereader.html#ImageReaderError-enum">QImageReader::ImageReaderError</a></span> <i>error</i> )<tt> [signal]</tt></h3>
  250. <p>This signal is emitted by <a href="qmovie.html">QMovie</a> when the error <i>error</i> occurred during playback. <a href="qmovie.html">QMovie</a> will stop the movie, and enter <a href="qmovie.html#MovieState-enum">QMovie::NotRunning</a> state.</p>
  251. <!-- @@@error -->
  252. <!-- $$$fileName[overload1]$$$fileName -->
  253. <h3 class="fn"><a name="fileName"></a><span class="type"><a href="qstring.html">QString</a></span> QMovie::<span class="name">fileName</span> () const</h3>
  254. <p>Returns the name of the file that <a href="qmovie.html">QMovie</a> reads image data from. If no file name has been assigned, or if the assigned device is not a file, an empty <a href="qstring.html">QString</a> is returned.</p>
  255. <p><b>See also </b><a href="qmovie.html#setFileName">setFileName</a>() and <a href="qmovie.html#device">device</a>().</p>
  256. <!-- @@@fileName -->
  257. <!-- $$$finished[overload1]$$$finished -->
  258. <h3 class="fn"><a name="finished"></a><span class="type">void</span> QMovie::<span class="name">finished</span> ()<tt> [signal]</tt></h3>
  259. <p>This signal is emitted when the movie has finished.</p>
  260. <p><b>See also </b><a href="qmovie.html#stop">QMovie::stop</a>().</p>
  261. <!-- @@@finished -->
  262. <!-- $$$format[overload1]$$$format -->
  263. <h3 class="fn"><a name="format"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QMovie::<span class="name">format</span> () const</h3>
  264. <p>Returns the format that <a href="qmovie.html">QMovie</a> uses when decoding image data. If no format has been assigned, an empty QByteArray() is returned.</p>
  265. <p><b>See also </b><a href="qmovie.html#setFormat">setFormat</a>().</p>
  266. <!-- @@@format -->
  267. <!-- $$$frameChanged[overload1]$$$frameChangedint -->
  268. <h3 class="fn"><a name="frameChanged"></a><span class="type">void</span> QMovie::<span class="name">frameChanged</span> ( <span class="type">int</span> <i>frameNumber</i> )<tt> [signal]</tt></h3>
  269. <p>This signal is emitted when the frame number has changed to <i>frameNumber</i>. You can call <a href="qmovie.html#currentImage">currentImage</a>() or <a href="qmovie.html#currentPixmap">currentPixmap</a>() to get a copy of the frame.</p>
  270. <p>This function was introduced in Qt 4.1.</p>
  271. <!-- @@@frameChanged -->
  272. <!-- $$$frameCount[overload1]$$$frameCount -->
  273. <h3 class="fn"><a name="frameCount"></a><span class="type">int</span> QMovie::<span class="name">frameCount</span> () const</h3>
  274. <p>Returns the number of frames in the movie.</p>
  275. <p>Certain animation formats do not support this feature, in which case 0 is returned.</p>
  276. <!-- @@@frameCount -->
  277. <!-- $$$frameRect[overload1]$$$frameRect -->
  278. <h3 class="fn"><a name="frameRect"></a><span class="type"><a href="qrect.html">QRect</a></span> QMovie::<span class="name">frameRect</span> () const</h3>
  279. <p>Returns the rect of the last frame. If no frame has yet been updated, an invalid <a href="qrect.html">QRect</a> is returned.</p>
  280. <p><b>See also </b><a href="qmovie.html#currentImage">currentImage</a>() and <a href="qmovie.html#currentPixmap">currentPixmap</a>().</p>
  281. <!-- @@@frameRect -->
  282. <!-- $$$isValid[overload1]$$$isValid -->
  283. <h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QMovie::<span class="name">isValid</span> () const</h3>
  284. <p>Returns true if the movie is valid (e.g&#x2e;, the image data is readable and the image format is supported); otherwise returns false.</p>
  285. <!-- @@@isValid -->
  286. <!-- $$$jumpToFrame[overload1]$$$jumpToFrameint -->
  287. <h3 class="fn"><a name="jumpToFrame"></a><span class="type">bool</span> QMovie::<span class="name">jumpToFrame</span> ( <span class="type">int</span> <i>frameNumber</i> )</h3>
  288. <p>Jumps to frame number <i>frameNumber</i>. Returns true on success; otherwise returns false.</p>
  289. <!-- @@@jumpToFrame -->
  290. <!-- $$$jumpToNextFrame[overload1]$$$jumpToNextFrame -->
  291. <h3 class="fn"><a name="jumpToNextFrame"></a><span class="type">bool</span> QMovie::<span class="name">jumpToNextFrame</span> ()<tt> [slot]</tt></h3>
  292. <p>Jumps to the next frame. Returns true on success; otherwise returns false.</p>
  293. <!-- @@@jumpToNextFrame -->
  294. <!-- $$$loopCount[overload1]$$$loopCount -->
  295. <h3 class="fn"><a name="loopCount"></a><span class="type">int</span> QMovie::<span class="name">loopCount</span> () const</h3>
  296. <p>Returns the number of times the movie will loop before it finishes. If the movie will only play once (no looping), loopCount returns 0. If the movie loops forever, loopCount returns -1.</p>
  297. <p>Note that, if the image data comes from a sequential device (e.g&#x2e; a socket), <a href="qmovie.html">QMovie</a> can only loop the movie if the <a href="qmovie.html#cacheMode-prop">cacheMode</a> is set to <a href="qmovie.html#CacheMode-enum">QMovie::CacheAll</a>.</p>
  298. <!-- @@@loopCount -->
  299. <!-- $$$nextFrameDelay[overload1]$$$nextFrameDelay -->
  300. <h3 class="fn"><a name="nextFrameDelay"></a><span class="type">int</span> QMovie::<span class="name">nextFrameDelay</span> () const</h3>
  301. <p>Returns the number of milliseconds <a href="qmovie.html">QMovie</a> will wait before updating the next frame in the animation.</p>
  302. <!-- @@@nextFrameDelay -->
  303. <!-- $$$resized[overload1]$$$resizedconstQSize& -->
  304. <h3 class="fn"><a name="resized"></a><span class="type">void</span> QMovie::<span class="name">resized</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )<tt> [signal]</tt></h3>
  305. <p>This signal is emitted when the current frame has been resized to <i>size</i>. This effect is sometimes used in animations as an alternative to replacing the frame. You can call <a href="qmovie.html#currentImage">currentImage</a>() or <a href="qmovie.html#currentPixmap">currentPixmap</a>() to get a copy of the updated frame.</p>
  306. <!-- @@@resized -->
  307. <!-- $$$scaledSize[overload1]$$$scaledSize -->
  308. <h3 class="fn"><a name="scaledSize"></a><span class="type"><a href="qsize.html">QSize</a></span> QMovie::<span class="name">scaledSize</span> ()</h3>
  309. <p>Returns the scaled size of frames.</p>
  310. <p>This function was introduced in Qt 4.1.</p>
  311. <p><b>See also </b><a href="qmovie.html#setScaledSize">setScaledSize</a>() and <a href="qimagereader.html#scaledSize">QImageReader::scaledSize</a>().</p>
  312. <!-- @@@scaledSize -->
  313. <!-- $$$setBackgroundColor[overload1]$$$setBackgroundColorconstQColor& -->
  314. <h3 class="fn"><a name="setBackgroundColor"></a><span class="type">void</span> QMovie::<span class="name">setBackgroundColor</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>color</i> )</h3>
  315. <p>For image formats that support it, this function sets the background color to <i>color</i>.</p>
  316. <p><b>See also </b><a href="qmovie.html#backgroundColor">backgroundColor</a>().</p>
  317. <!-- @@@setBackgroundColor -->
  318. <!-- $$$setDevice[overload1]$$$setDeviceQIODevice* -->
  319. <h3 class="fn"><a name="setDevice"></a><span class="type">void</span> QMovie::<span class="name">setDevice</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i> )</h3>
  320. <p>Sets the current device to <i>device</i>. <a href="qmovie.html">QMovie</a> will read image data from this device when the movie is running.</p>
  321. <p><b>See also </b><a href="qmovie.html#device">device</a>() and <a href="qmovie.html#setFormat">setFormat</a>().</p>
  322. <!-- @@@setDevice -->
  323. <!-- $$$setFileName[overload1]$$$setFileNameconstQString& -->
  324. <h3 class="fn"><a name="setFileName"></a><span class="type">void</span> QMovie::<span class="name">setFileName</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i> )</h3>
  325. <p>Sets the name of the file that <a href="qmovie.html">QMovie</a> reads image data from, to <i>fileName</i>.</p>
  326. <p><b>See also </b><a href="qmovie.html#fileName">fileName</a>(), <a href="qmovie.html#setDevice">setDevice</a>(), and <a href="qmovie.html#setFormat">setFormat</a>().</p>
  327. <!-- @@@setFileName -->
  328. <!-- $$$setFormat[overload1]$$$setFormatconstQByteArray& -->
  329. <h3 class="fn"><a name="setFormat"></a><span class="type">void</span> QMovie::<span class="name">setFormat</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>format</i> )</h3>
  330. <p>Sets the format that <a href="qmovie.html">QMovie</a> will use when decoding image data, to <i>format</i>. By default, <a href="qmovie.html">QMovie</a> will attempt to guess the format of the image data.</p>
  331. <p>You can call <a href="qmovie.html#supportedFormats">supportedFormats</a>() for the full list of formats <a href="qmovie.html">QMovie</a> supports.</p>
  332. <p><b>See also </b><a href="qmovie.html#format">format</a>() and <a href="qimagereader.html#supportedImageFormats">QImageReader::supportedImageFormats</a>().</p>
  333. <!-- @@@setFormat -->
  334. <!-- $$$setPaused[overload1]$$$setPausedbool -->
  335. <h3 class="fn"><a name="setPaused"></a><span class="type">void</span> QMovie::<span class="name">setPaused</span> ( <span class="type">bool</span> <i>paused</i> )<tt> [slot]</tt></h3>
  336. <p>If <i>paused</i> is true, <a href="qmovie.html">QMovie</a> will enter <a href="qmovie.html#MovieState-enum">Paused</a> state and emit stateChanged(Paused); otherwise it will enter <a href="qmovie.html#MovieState-enum">Running</a> state and emit stateChanged(Running).</p>
  337. <p><b>See also </b><a href="qmovie-qt3.html#paused" class="compat">paused</a>() and <a href="qmovie.html#state">state</a>().</p>
  338. <!-- @@@setPaused -->
  339. <!-- $$$setScaledSize[overload1]$$$setScaledSizeconstQSize& -->
  340. <h3 class="fn"><a name="setScaledSize"></a><span class="type">void</span> QMovie::<span class="name">setScaledSize</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )</h3>
  341. <p>Sets the scaled frame size to <i>size</i>.</p>
  342. <p>This function was introduced in Qt 4.1.</p>
  343. <p><b>See also </b><a href="qmovie.html#scaledSize">scaledSize</a>() and <a href="qimagereader.html#setScaledSize">QImageReader::setScaledSize</a>().</p>
  344. <!-- @@@setScaledSize -->
  345. <!-- $$$start[overload1]$$$start -->
  346. <h3 class="fn"><a name="start"></a><span class="type">void</span> QMovie::<span class="name">start</span> ()<tt> [slot]</tt></h3>
  347. <p>Starts the movie. <a href="qmovie.html">QMovie</a> will enter <a href="qmovie.html#MovieState-enum">Running</a> state, and start emitting <a href="qmovie.html#updated">updated</a>() and <a href="qmovie.html#resized">resized</a>() as the movie progresses.</p>
  348. <p>If <a href="qmovie.html">QMovie</a> is in the <a href="qmovie.html#MovieState-enum">Paused</a> state, this function is equivalent to calling setPaused(false). If <a href="qmovie.html">QMovie</a> is already in the <a href="qmovie.html#MovieState-enum">Running</a> state, this function does nothing.</p>
  349. <p><b>See also </b><a href="qmovie.html#stop">stop</a>() and <a href="qmovie.html#setPaused">setPaused</a>().</p>
  350. <!-- @@@start -->
  351. <!-- $$$started[overload1]$$$started -->
  352. <h3 class="fn"><a name="started"></a><span class="type">void</span> QMovie::<span class="name">started</span> ()<tt> [signal]</tt></h3>
  353. <p>This signal is emitted after <a href="qmovie.html#start">QMovie::start</a>() has been called, and <a href="qmovie.html">QMovie</a> has entered <a href="qmovie.html#MovieState-enum">QMovie::Running</a> state.</p>
  354. <!-- @@@started -->
  355. <!-- $$$state[overload1]$$$state -->
  356. <h3 class="fn"><a name="state"></a><span class="type"><a href="qmovie.html#MovieState-enum">MovieState</a></span> QMovie::<span class="name">state</span> () const</h3>
  357. <p>Returns the current state of <a href="qmovie.html">QMovie</a>.</p>
  358. <p><b>See also </b><a href="qmovie.html#MovieState-enum">MovieState</a> and <a href="qmovie.html#stateChanged">stateChanged</a>().</p>
  359. <!-- @@@state -->
  360. <!-- $$$stateChanged[overload1]$$$stateChangedQMovie::MovieState -->
  361. <h3 class="fn"><a name="stateChanged"></a><span class="type">void</span> QMovie::<span class="name">stateChanged</span> ( <span class="type"><a href="qmovie.html#MovieState-enum">QMovie::MovieState</a></span> <i>state</i> )<tt> [signal]</tt></h3>
  362. <p>This signal is emitted every time the state of the movie changes. The new state is specified by <i>state</i>.</p>
  363. <p><b>See also </b><a href="qmovie.html#state">QMovie::state</a>().</p>
  364. <!-- @@@stateChanged -->
  365. <!-- $$$stop[overload1]$$$stop -->
  366. <h3 class="fn"><a name="stop"></a><span class="type">void</span> QMovie::<span class="name">stop</span> ()<tt> [slot]</tt></h3>
  367. <p>Stops the movie. <a href="qmovie.html">QMovie</a> enters <a href="qmovie.html#MovieState-enum">NotRunning</a> state, and stops emitting <a href="qmovie.html#updated">updated</a>() and <a href="qmovie.html#resized">resized</a>(). If <a href="qmovie.html#start">start</a>() is called again, the movie will restart from the beginning.</p>
  368. <p>If <a href="qmovie.html">QMovie</a> is already in the <a href="qmovie.html#MovieState-enum">NotRunning</a> state, this function does nothing.</p>
  369. <p><b>See also </b><a href="qmovie.html#start">start</a>() and <a href="qmovie.html#setPaused">setPaused</a>().</p>
  370. <!-- @@@stop -->
  371. <!-- $$$supportedFormats[overload1]$$$supportedFormats -->
  372. <h3 class="fn"><a name="supportedFormats"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qbytearray.html">QByteArray</a></span>&gt; QMovie::<span class="name">supportedFormats</span> ()<tt> [static]</tt></h3>
  373. <p>Returns the list of image formats supported by <a href="qmovie.html">QMovie</a>.</p>
  374. <p>This function was introduced in Qt 4.1.</p>
  375. <p><b>See also </b><a href="qimagereader.html#supportedImageFormats">QImageReader::supportedImageFormats</a>().</p>
  376. <!-- @@@supportedFormats -->
  377. <!-- $$$updated[overload1]$$$updatedconstQRect& -->
  378. <h3 class="fn"><a name="updated"></a><span class="type">void</span> QMovie::<span class="name">updated</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>rect</i> )<tt> [signal]</tt></h3>
  379. <p>This signal is emitted when the rect <i>rect</i> in the current frame has been updated. You can call <a href="qmovie.html#currentImage">currentImage</a>() or <a href="qmovie.html#currentPixmap">currentPixmap</a>() to get a copy of the updated frame.</p>
  380. <!-- @@@updated -->
  381. </div>
  382. <div class="ft">
  383. <span></span>
  384. </div>
  385. </div>
  386. <div class="footer">
  387. <p>
  388. <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
  389. subsidiaries. Documentation contributions included herein are the copyrights of
  390. their respective owners.</p>
  391. <br />
  392. <p>
  393. The documentation provided herein is licensed under the terms of the
  394. <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
  395. License version 1.3</a> as published by the Free Software Foundation.</p>
  396. <p>
  397. Documentation sources may be obtained from <a href="http://www.qt-project.org">
  398. www.qt-project.org</a>.</p>
  399. <br />
  400. <p>
  401. Nokia, Qt and their respective logos are trademarks of Nokia Corporation
  402. in Finland and/or other countries worldwide. All other trademarks are property
  403. of their respective owners. <a title="Privacy Policy"
  404. href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  405. </div>
  406. </body>
  407. </html>