QGIS API Documentation  3.6.0-Noosa (5873452)
Signals | Public Member Functions | List of all members
QgsAnimatedIcon Class Reference

Animated icon is keeping an animation running if there are listeners connected to frameChanged. More...

#include <qgsanimatedicon.h>

Inheritance diagram for QgsAnimatedIcon:
Inheritance graph
[legend]

Signals

void frameChanged ()
 Emitted when the icon changed. More...
 

Public Member Functions

 QgsAnimatedIcon (const QString &iconPath=QString(), QObject *parent=nullptr)
 Create a new animated icon. More...
 
template<typename Func1 >
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 current icon and trigger UI updates. More...
 
bool connectFrameChanged (const QObject *receiver, const char *method)
 Connect a slot that will be notified repeatedly whenever a frame changes and which should request the current icon and trigger UI updates. More...
 
template<typename Func1 >
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. More...
 
bool disconnectFrameChanged (const QObject *receiver, const char *method)
 Convenience function to disconnect the same style that the frame change connection was established. More...
 
int height () const
 The native height of the icon. More...
 
QIcon icon () const
 Gets the icons representation in the current frame. More...
 
QString iconPath () const
 Path to a movie, e.g. More...
 
void setIconPath (const QString &iconPath)
 Path to a movie, e.g. More...
 
int width () const
 The native width of the icon. More...
 

Detailed Description

Animated icon is keeping an animation running if there are listeners connected to frameChanged.

Definition at line 30 of file qgsanimatedicon.h.

Constructor & Destructor Documentation

◆ QgsAnimatedIcon()

QgsAnimatedIcon::QgsAnimatedIcon ( const QString &  iconPath = QString(),
QObject *  parent = nullptr 
)

Create a new animated icon.

Optionally, the iconPath can already be specified.

Definition at line 19 of file qgsanimatedicon.cpp.

Member Function Documentation

◆ connectFrameChanged() [1/2]

template<typename Func1 >
bool QgsAnimatedIcon::connectFrameChanged ( const typename QtPrivate::FunctionPointer< Func1 >::Object *  receiver,
Func1  slot 
)
inline

Connect a slot that will be notified repeatedly whenever a frame changes and which should request the current icon and trigger UI updates.

Connect to the frame changed signal with this method and not directly. This method makes sure the annimation is started.

Note
Available in Python bindings as bool connectFrameChanged( const QObject *receiver, const char *method );.
Since
QGIS 3.0

Definition at line 71 of file qgsanimatedicon.h.

◆ connectFrameChanged() [2/2]

bool QgsAnimatedIcon::connectFrameChanged ( const QObject *  receiver,
const char *  method 
)

Connect a slot that will be notified repeatedly whenever a frame changes and which should request the current icon and trigger UI updates.

Connect to the frame changed signal with this method and not directly. This method makes sure the annimation is started.

Since
QGIS 3.0

Definition at line 46 of file qgsanimatedicon.cpp.

◆ disconnectFrameChanged() [1/2]

template<typename Func1 >
bool QgsAnimatedIcon::disconnectFrameChanged ( const typename QtPrivate::FunctionPointer< Func1 >::Object *  receiver,
Func1  slot 
)
inline

Convenience function to disconnect the same style that the frame change connection was established.

Note
Available in Python bindings as bool disconnectFrameChanged( const QObject *receiver, const char *method );.
Since
QGIS 3.0

Definition at line 90 of file qgsanimatedicon.h.

◆ disconnectFrameChanged() [2/2]

bool QgsAnimatedIcon::disconnectFrameChanged ( const QObject *  receiver,
const char *  method 
)

Convenience function to disconnect the same style that the frame change connection was established.

Since
QGIS 3.0

Definition at line 57 of file qgsanimatedicon.cpp.

◆ frameChanged

void QgsAnimatedIcon::frameChanged ( )
signal

Emitted when the icon changed.

You should use connectFrameChanged instead of connecting to this signal directly. Connecting to this signal directly will cause the animation not to be started.

See also
connectFrameChanged

◆ height()

int QgsAnimatedIcon::height ( ) const

The native height of the icon.

Since
QGIS 3.0

Definition at line 67 of file qgsanimatedicon.cpp.

◆ icon()

QIcon QgsAnimatedIcon::icon ( ) const

Gets the icons representation in the current frame.

This will need to be called repeatedly, whenever a frameChanged() signal is emitted.

Definition at line 41 of file qgsanimatedicon.cpp.

◆ iconPath()

QString QgsAnimatedIcon::iconPath ( ) const

Path to a movie, e.g.

animated GIF

Definition at line 31 of file qgsanimatedicon.cpp.

◆ setIconPath()

void QgsAnimatedIcon::setIconPath ( const QString &  iconPath)

Path to a movie, e.g.

animated GIF

Definition at line 36 of file qgsanimatedicon.cpp.

◆ width()

int QgsAnimatedIcon::width ( ) const

The native width of the icon.

Since
QGIS 3.0

Definition at line 62 of file qgsanimatedicon.cpp.


The documentation for this class was generated from the following files: