Class: QgsTemporalNavigationObject

class qgis.core.QgsTemporalNavigationObject(parent: QObject = None)

Bases: QgsTemporalController, QgsExpressionContextScopeGenerator

Constructor for QgsTemporalNavigationObject, with the specified parent object.

Implements a temporal controller based on a frame by frame navigation and animation.

New in version 3.14.

Parameters

parent

Animated = 1
class AnimationState

Bases: int

FixedRange = 2
Forward = 0
Idle = 2
class NavigationMode

Bases: int

NavigationOff = 0
Reverse = 1
animationState(self) → QgsTemporalNavigationObject.AnimationState

Returns the current animation state.

Return type

QgsTemporalNavigationObject.AnimationState

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createExpressionContextScope(self)QgsExpressionContextScope
Return type

QgsExpressionContextScope

currentFrameNumber(self) → int

Returns the current frame number.

Return type

int

customEvent(self, QEvent)
dateTimeRangeForFrameNumber(self, frame: int)QgsDateTimeRange

Calculates the temporal range associated with a particular animation frame.

This is calculated from the navigation start time (taken from temporalExtents()), the specified frame number, and the frame duration (see frameDuration()).

Parameters

frame (int) –

Return type

QgsDateTimeRange

disconnectNotify(self, QMetaMethod)
frameDuration(self)QgsInterval

Returns the current set frame duration, which dictates the temporal length of each frame in the animation.

Return type

QgsInterval

framesPerSecond(self) → float

Returns the animation frame rate, in frames per second.

This setting controls the overall playback speed of the animation, i.e. how quickly a playing animation will advance to the next frame.

Return type

float

isLooping(self) → bool

Returns True if the animation should loop after hitting the end or start frame.

See also

setLooping()

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
navigationMode(self) → QgsTemporalNavigationObject.NavigationMode

Returns the currenttemporal navigation mode.

Return type

QgsTemporalNavigationObject.NavigationMode

navigationModeChanged

Emitted whenever the navigation mode changes. [signal]

Parameters

mode (QgsTemporalNavigationObject.NavigationMode) –

next(self)

Advances to the next frame.

Note

Calling this slot does not change the current animation state, i.e. a paused animation will remain paused.

pause(self)

Pauses the temporal navigation.

Calling this slot changes the animation state to idle, preventing automatic advancement of frames.

It does not affect the current animation frame number or the current temporal range of the controller.

play(self)

Starts playing the temporal navigation from its current frame, using the direction specified by animationState()

playBackward(self)

Starts the animation playing in a reverse direction until the beginning of the time range.

playForward(self)

Starts the animation playing in a forward direction up till the end of all frames.

previous(self)

Jumps back to the previous frame.

Note

Calling this slot does not change the current animation state, i.e. a paused animation will remain paused.

receivers(self, PYQT_SIGNAL) → int
rewindToStart(self)

Rewinds the temporal navigation to start of the temporal extent.

sender(self) → QObject
senderSignalIndex(self) → int
setAnimationState(self, state: QgsTemporalNavigationObject.AnimationState)

Sets the current animation state.

See also

animationState()

Parameters

state (QgsTemporalNavigationObject.AnimationState) –

setCurrentFrameNumber(self, frame: int)

Sets the current animation frame number.

Caling this method will change the controllers current datetime range to match, based on the temporalExtents() and frameDuration() values.

Parameters

frame (int) –

setFrameDuration(self, duration: QgsInterval)

Sets the frame duration, which dictates the temporal length of each frame in the animation.

Note

Calling this will reset the currentFrameNumber() to the first frame.

See also

frameDuration()

Parameters

duration (QgsInterval) –

setFramesPerSecond(self, rate: float)

Sets the animation frame rate, in frames per second.

This setting controls the overall playback speed of the animation, i.e. how quickly a playing animation will advance to the next frame.

Parameters

rate (float) –

setLooping(self, loop: bool)

Sets whether the animation should loop after hitting the end or start frame.

See also

isLooping()

Parameters

loop (bool) –

setNavigationMode(self, mode: QgsTemporalNavigationObject.NavigationMode)

Sets the temporal navigation mode.

See also

navigationMode()

Parameters

mode (QgsTemporalNavigationObject.NavigationMode) –

setTemporalExtents(self, extents: QgsDateTimeRange)

Sets the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.

Note

Calling this will reset the currentFrameNumber() to the first frame.

Parameters

extents (QgsDateTimeRange) –

setTemporalRangeCumulative(self, state: bool)

Sets the animation temporal range as cumulative.

Parameters

state (bool) –

skipToEnd(self)

Skips the temporal navigation to end of the temporal extent.

stateChanged

Emitted whenever the animation state changes. [signal]

Parameters

state (QgsTemporalNavigationObject.AnimationState) –

temporalExtents(self)QgsDateTimeRange

Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.

Return type

QgsDateTimeRange

temporalRangeCumulative(self) → bool

Returns the animation temporal range cumulative settings.

Return type

bool

timerEvent(self, QTimerEvent)
totalFrameCount(self) → int

Returns the total number of frames for the navigation.

Return type

int