mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
QMovie review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3f06e61a8f
commit
464d7b2eeb
2 changed files with 53 additions and 55 deletions
|
@ -128,8 +128,6 @@
|
||||||
#include "qobject_p.h"
|
#include "qobject_p.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
|
|
||||||
#define QMOVIE_INVALID_DELAY -1
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QMoviePrivate : public QObjectPrivate
|
class QMoviePrivate : public QObjectPrivate
|
||||||
|
@ -388,33 +386,44 @@ QColor QMovie::backgroundColor() const
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the current state of QMovie.
|
\since 4.1
|
||||||
|
|
||||||
\sa MovieState, stateChanged()
|
Returns the scaled size of frames.
|
||||||
|
|
||||||
|
\sa QImageReader::scaledSize()
|
||||||
*/
|
*/
|
||||||
QMovie::MovieState QMovie::state() const
|
QSize QMovie::scaledSize() const
|
||||||
{
|
{
|
||||||
Q_D(const QMovie);
|
Q_D(const QMovie);
|
||||||
return d->movieState;
|
return d->reader->scaledSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the current frame as a QImage.
|
\since 4.1
|
||||||
|
|
||||||
|
Sets the scaled frame size to \a size.
|
||||||
|
|
||||||
|
\sa QImageReader::setScaledSize()
|
||||||
*/
|
*/
|
||||||
QImage QMovie::currentImage() const
|
void QMovie::setScaledSize(const QSize &size)
|
||||||
{
|
{
|
||||||
Q_D(const QMovie);
|
Q_D(QMovie);
|
||||||
return d->currentImage;
|
d->reader->setScaledSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns true if the movie is valid (e.g., the image data is readable and
|
Returns the number of times the movie will loop before it finishes.
|
||||||
the image format is supported); otherwise returns false.
|
If the movie will only play once (no looping), loopCount returns 0.
|
||||||
|
If the movie loops forever, loopCount returns -1.
|
||||||
|
|
||||||
|
Note that, if the image data comes from a sequential device (e.g. a
|
||||||
|
socket), QMovie can only loop the movie if the cacheMode is set to
|
||||||
|
QMovie::CacheAll.
|
||||||
*/
|
*/
|
||||||
bool QMovie::isValid() const
|
int QMovie::loopCount() const
|
||||||
{
|
{
|
||||||
Q_D(const QMovie);
|
Q_D(const QMovie);
|
||||||
return d->reader->canRead();
|
return d->reader->loopCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -450,18 +459,33 @@ int QMovie::currentFrameNumber() const
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the number of times the movie will loop before it finishes.
|
Returns the current state of QMovie.
|
||||||
If the movie will only play once (no looping), loopCount returns 0.
|
|
||||||
If the movie loops forever, loopCount returns -1.
|
|
||||||
|
|
||||||
Note that, if the image data comes from a sequential device (e.g. a
|
\sa MovieState, stateChanged()
|
||||||
socket), QMovie can only loop the movie if the cacheMode is set to
|
|
||||||
QMovie::CacheAll.
|
|
||||||
*/
|
*/
|
||||||
int QMovie::loopCount() const
|
QMovie::MovieState QMovie::state() const
|
||||||
{
|
{
|
||||||
Q_D(const QMovie);
|
Q_D(const QMovie);
|
||||||
return d->reader->loopCount();
|
return d->movieState;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the current frame as a QImage.
|
||||||
|
*/
|
||||||
|
QImage QMovie::currentImage() const
|
||||||
|
{
|
||||||
|
Q_D(const QMovie);
|
||||||
|
return d->currentImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns true if the movie is valid (e.g., the image data is readable and
|
||||||
|
the image format is supported); otherwise returns false.
|
||||||
|
*/
|
||||||
|
bool QMovie::isValid() const
|
||||||
|
{
|
||||||
|
Q_D(const QMovie);
|
||||||
|
return d->reader->canRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -500,32 +524,6 @@ void QMovie::stop()
|
||||||
d->done();
|
d->done();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\since 4.1
|
|
||||||
|
|
||||||
Returns the scaled size of frames.
|
|
||||||
|
|
||||||
\sa QImageReader::scaledSize()
|
|
||||||
*/
|
|
||||||
QSize QMovie::scaledSize() const
|
|
||||||
{
|
|
||||||
Q_D(const QMovie);
|
|
||||||
return d->reader->scaledSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\since 4.1
|
|
||||||
|
|
||||||
Sets the scaled frame size to \a size.
|
|
||||||
|
|
||||||
\sa QImageReader::setScaledSize()
|
|
||||||
*/
|
|
||||||
void QMovie::setScaledSize(const QSize &size)
|
|
||||||
{
|
|
||||||
Q_D(QMovie);
|
|
||||||
d->reader->setScaledSize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\since 4.1
|
\since 4.1
|
||||||
|
|
||||||
|
|
|
@ -74,19 +74,19 @@ public:
|
||||||
void setBackgroundColor(const QColor &color);
|
void setBackgroundColor(const QColor &color);
|
||||||
QColor backgroundColor() const;
|
QColor backgroundColor() const;
|
||||||
|
|
||||||
MovieState state() const;
|
QSize scaledSize() const;
|
||||||
|
void setScaledSize(const QSize &size);
|
||||||
QImage currentImage() const;
|
|
||||||
|
|
||||||
bool isValid() const;
|
|
||||||
|
|
||||||
int loopCount() const;
|
int loopCount() const;
|
||||||
int frameCount() const;
|
int frameCount() const;
|
||||||
int nextFrameDelay() const;
|
int nextFrameDelay() const;
|
||||||
int currentFrameNumber() const;
|
int currentFrameNumber() const;
|
||||||
|
|
||||||
QSize scaledSize() const;
|
MovieState state() const;
|
||||||
void setScaledSize(const QSize &size);
|
|
||||||
|
QImage currentImage() const;
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void started();
|
void started();
|
||||||
|
|
Loading…
Add table
Reference in a new issue