21 , mMovie( new QMovie( this ) )
27 mMovie->setCacheMode( QMovie::CacheAll );
28 connect( mMovie, &QMovie::frameChanged,
this, &QgsAnimatedIcon::onFrameChanged );
33 return mMovie->fileName();
48 if ( connect(
this, SIGNAL(
frameChanged() ), receiver, method ) )
50 mMovie->setPaused(
false );
59 return disconnect(
this, SIGNAL(
frameChanged() ), receiver, method );
64 return mMovie->currentPixmap().width();
69 return mMovie->currentPixmap().height();
71void QgsAnimatedIcon::onFrameChanged()
74 mMovie->setPaused(
true );
76 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.