Class: QgsAnimatedIcon

class qgis.core.QgsAnimatedIcon(iconPath: str = '', parent: QObject = None)

Bases: PyQt5.QtCore.QObject

Create a new animated icon. Optionally, the iconPath can already be specified.

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

Parameters
  • iconPath (str = '') –

  • parent

childEvent()
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.

New in version 3.0.

Parameters
  • receiver (QObject) –

  • method (str) –

Return type

bool

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

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

New in version 3.0.

Parameters
  • receiver (QObject) –

  • method (str) –

Return type

bool

disconnectNotify()
frameChanged

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() [signal]

height(self) → int

The native height of the icon.

New in version 3.0.

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()
receivers()
sender()
senderSignalIndex()
setIconPath(self, iconPath: str)

Path to a movie, e.g. animated GIF

Parameters

iconPath (str) –

timerEvent()
width(self) → int

The native width of the icon.

New in version 3.0.

Return type

int