QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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.
 

Public Member Functions

 QgsAnimatedIcon (const QString &iconPath=QString(), QObject *parent=nullptr)
 Create a new animated icon.
 
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.
 
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.
 
bool disconnectFrameChanged (const QObject *receiver, const char *method)
 Convenience function to disconnect the same style that the frame change connection was established.
 
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.
 
int height () const
 The native height of the icon.
 
QIcon icon () const
 Gets the icons representation in the current frame.
 
QString iconPath () const
 Path to a movie, e.g.
 
void setIconPath (const QString &iconPath)
 Path to a movie, e.g.
 
int width () const
 The native width of the icon.
 

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 20 of file qgsanimatedicon.cpp.

Member Function Documentation

◆ connectFrameChanged() [1/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.

Definition at line 47 of file qgsanimatedicon.cpp.

◆ connectFrameChanged() [2/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 );.

Definition at line 70 of file qgsanimatedicon.h.

◆ disconnectFrameChanged() [1/2]

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

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

Definition at line 58 of file qgsanimatedicon.cpp.

◆ disconnectFrameChanged() [2/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 );.

Definition at line 88 of file qgsanimatedicon.h.

◆ 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.

Definition at line 68 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 42 of file qgsanimatedicon.cpp.

◆ iconPath()

QString QgsAnimatedIcon::iconPath ( ) const

Path to a movie, e.g.

animated GIF

Definition at line 32 of file qgsanimatedicon.cpp.

◆ setIconPath()

void QgsAnimatedIcon::setIconPath ( const QString &  iconPath)

Path to a movie, e.g.

animated GIF

Definition at line 37 of file qgsanimatedicon.cpp.

◆ width()

int QgsAnimatedIcon::width ( ) const

The native width of the icon.

Definition at line 63 of file qgsanimatedicon.cpp.


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