Class: QgsAnimatedIcon

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

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnimatedIcon

Base classes

QObject

Methods

connectFrameChanged

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

disconnectFrameChanged

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

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.

setIconPath

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

width

The native width of the icon.

Signals

frameChanged

Emitted when the icon changed.

class qgis.core.QgsAnimatedIcon[source]

Bases: QObject

__init__(iconPath: str | None = '', parent: QObject | None = None)

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

Parameters:
  • iconPath (Optional[str] = '')

  • parent (Optional[QObject] = None)

connectFrameChanged(self, receiver: QObject | None, method: str | None) bool[source]

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

  • method (Optional[str])

Return type:

bool

disconnectFrameChanged(self, receiver: QObject | None, method: str | None) bool[source]

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

Parameters:
  • receiver (Optional[QObject])

  • method (Optional[str])

Return type:

bool

signal frameChanged[source]

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.

height(self) int[source]

The native height of the icon.

Return type:

int

icon(self) QIcon[source]

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[source]

Path to a movie, e.g. animated GIF

Return type:

str

setIconPath(self, iconPath: str | None)[source]

Path to a movie, e.g. animated GIF

Parameters:

iconPath (Optional[str])

width(self) int[source]

The native width of the icon.

Return type:

int