Class: QgsProjectTimeSettings

Contains temporal settings and properties for the project, this may be used when animating maps or showing temporal layers.

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProjectTimeSettings

Base classes

QObject

Methods

framesPerSecond

Returns the project's default animation frame rate, in frames per second.

isTemporalRangeCumulative

Returns the value of cumulative temporal range in animation settings.

readXml

Reads the settings's state from a DOM element.

reset

Resets the settings to a default state.

setFramesPerSecond

Sets the project's default animation frame rate, in frames per second.

setIsTemporalRangeCumulative

Sets the project's temporal range as cumulative in animation settings.

setTemporalRange

Sets the project's temporal range, which indicates the earliest and latest datetime ranges associated with the project.

setTimeStep

Sets the project's time step (length of one animation frame), which is used as the default value when animating the project.

setTimeStepUnit

Sets the project's time step (length of one animation frame) unit, which is used as the default value when animating the project.

setTotalMovieFrames

Sets the total number of frames for the movie.

temporalRange

Returns the project's temporal range, which indicates the earliest and latest datetime ranges associated with the project.

timeStep

Returns the project's time step (length of one animation frame), which is used as the default value when animating the project.

timeStepUnit

Returns the project's time step (length of one animation frame) unit, which is used as the default value when animating the project.

totalMovieFrames

Returns the total number of frames for the project's movie.

writeXml

Returns a DOM element representing the settings.

Signals

temporalRangeChanged

Emitted when the temporal range changes.

class qgis.core.QgsProjectTimeSettings[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor for QgsProjectTimeSettings with the specified parent object.

Parameters:

parent (Optional[QObject] = None)

framesPerSecond(self) float[source]

Returns the project’s default animation frame rate, in frames per second.

Return type:

float

isTemporalRangeCumulative(self) bool[source]

Returns the value of cumulative temporal range in animation settings.

Return type:

bool

readXml(self, element: QDomElement, context: QgsReadWriteContext) bool[source]

Reads the settings’s state from a DOM element.

See also

writeXml()

Parameters:
Return type:

bool

reset(self)[source]

Resets the settings to a default state.

setFramesPerSecond(self, rate: float)[source]

Sets the project’s default animation frame rate, in frames per second.

Parameters:

rate (float)

setIsTemporalRangeCumulative(self, state: bool)[source]

Sets the project’s temporal range as cumulative in animation settings.

Parameters:

state (bool)

setTemporalRange(self, range: QgsDateTimeRange)[source]

Sets the project’s temporal range, which indicates the earliest and latest datetime ranges associated with the project.

Note

This is a manual, use-set property, and does not necessarily coincide with the earliest and latest temporal ranges set for individual layers in the project.

See also

temporalRange()

Parameters:

range (QgsDateTimeRange)

setTimeStep(self, step: float)[source]

Sets the project’s time step (length of one animation frame), which is used as the default value when animating the project.

Units are specified via setTimeStepUnit()

See also

timeStep()

Parameters:

step (float)

setTimeStepUnit(self, unit: Qgis.TemporalUnit)[source]

Sets the project’s time step (length of one animation frame) unit, which is used as the default value when animating the project.

See also

timeStepUnit()

See also

setTimeStep()

Parameters:

unit (Qgis.TemporalUnit)

setTotalMovieFrames(self, frames: int)[source]

Sets the total number of frames for the movie.

Note

This is only used when the navigationm mode is set to Qgis.TemporalNavigationMode.Movie.

Added in version 3.36.

Parameters:

frames (int)

temporalRange(self) QgsDateTimeRange[source]

Returns the project’s temporal range, which indicates the earliest and latest datetime ranges associated with the project.

Note

This is a manual, use-set property, and does not necessarily coincide with the earliest and latest temporal ranges set for individual layers in the project.

Return type:

QgsDateTimeRange

signal temporalRangeChanged[source]

Emitted when the temporal range changes.

See also

temporalRange()

timeStep(self) float[source]

Returns the project’s time step (length of one animation frame), which is used as the default value when animating the project.

Units are specified via timeStepUnit()

See also

setTimeStep()

See also

timeStepUnit()

Return type:

float

timeStepUnit(self) Qgis.TemporalUnit[source]

Returns the project’s time step (length of one animation frame) unit, which is used as the default value when animating the project.

See also

timeStep()

Return type:

Qgis.TemporalUnit

totalMovieFrames(self) int

Returns the total number of frames for the project’s movie.

Note

This is only used when the navigation mode is set to Qgis.TemporalNavigationMode.Movie.

Added in version 3.36.

Return type:

int

writeXml(self, document: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Returns a DOM element representing the settings.

See also

readXml()

Parameters:
Return type:

QDomElement