18#include "moc_qgsanimatedicon.cpp"
22 , mMovie( new QMovie( this ) )
28 mMovie->setCacheMode( QMovie::CacheAll );
29 connect( mMovie, &QMovie::frameChanged,
this, &QgsAnimatedIcon::onFrameChanged );
34 return mMovie->fileName();
49 if ( connect(
this, SIGNAL(
frameChanged() ), receiver, method ) )
51 mMovie->setPaused(
false );
60 return disconnect(
this, SIGNAL(
frameChanged() ), receiver, method );
65 return mMovie->currentPixmap().width();
70 return mMovie->currentPixmap().height();
72void QgsAnimatedIcon::onFrameChanged()
75 mMovie->setPaused(
true );
77 mIcon = QIcon( mMovie->currentPixmap() );
bool disconnectFrameChanged(const typename QtPrivate::FunctionPointer< Func1 >::Object *receiver, Func1 slot)
Convenience function to disconnect the same style that the frame change connection was established.
void frameChanged()
Emitted when the icon changed.
QgsAnimatedIcon(const QString &iconPath=QString(), QObject *parent=nullptr)
Create a new animated icon.
int height() const
The native height of the icon.
int width() const
The native width of the icon.
bool connectFrameChanged(const typename QtPrivate::FunctionPointer< Func1 >::Object *receiver, Func1 slot)
Connect a slot that will be notified repeatedly whenever a frame changes and which should request the...
void setIconPath(const QString &iconPath)
Path to a movie, e.g.
QIcon icon() const
Gets the icons representation in the current frame.
QString iconPath() const
Path to a movie, e.g.