Class: QgsAnimatedIcon

class qgis.core.QgsAnimatedIcon

Bases: PyQt5.QtCore.QObject

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

QgsAnimatedIcon(iconPath: str = ‘’, parent: QObject = None) Create a new animated icon. Optionally, the iconPath can already be specified.

Methods

childEvent

connectFrameChanged

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

connectNotify

customEvent

disconnectFrameChanged

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

disconnectNotify

height

The native height of the icon.

icon

Gets the icons representation in the current frame.

iconPath

Path to a movie, e.g. animated GIF.

isSignalConnected

receivers

sender

senderSignalIndex

setIconPath

Path to a movie, e.g. animated GIF.

timerEvent

width

The native width of the icon.

Signals

frameChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

childEvent(self, QChildEvent)
connectFrameChanged(self, receiver: QObject, method: str) bool

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.

Parameters:
  • receiver (QObject) –

  • method (str) –

Return type:

bool

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectFrameChanged(self, receiver: QObject, method: str) bool

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

Parameters:
  • receiver (QObject) –

  • method (str) –

Return type:

bool

disconnectNotify(self, QMetaMethod)
frameChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

height(self) int

The native height of the icon.

Return type:

int

icon(self) QIcon

Gets the icons representation in the current frame. This will need to be called repeatedly, whenever a frameChanged() signal is emitted.

Return type:

QIcon

iconPath(self) str

Path to a movie, e.g. animated GIF

Return type:

str

isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setIconPath(self, iconPath: str)

Path to a movie, e.g. animated GIF

Parameters:

iconPath (str) –

timerEvent(self, QTimerEvent)
width(self) int

The native width of the icon.

Return type:

int