Class: QgsProjectGpsSettings

Contains settings and properties relating to how a QgsProject should interact with a GPS device.

Added in version 3.30.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProjectGpsSettings

Base classes

QObject

class qgis.core.QgsProjectGpsSettings[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor for QgsProjectGpsSettings with the specified parent object.

Parameters:

parent (Optional[QObject] = None)

automaticallyAddTrackVertices(self) bool[source]

Returns True if track vertices should be automatically created whenever new locations are received from the GPS device.

Return type:

bool

signal automaticallyAddTrackVerticesChanged[source]

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.

automaticallyCommitFeatures(self) bool[source]

Returns True if features created from GPS locations should be immediately committed to their target layers (skipping the usual layer edit buffer).

Return type:

bool

signal automaticallyCommitFeaturesChanged[source]

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.

destinationFollowsActiveLayer(self) bool[source]

Returns True if the destination layer for storing features digitized from GPS should follow the current active layer automatically.

Return type:

bool

signal destinationFollowsActiveLayerChanged[source]

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.

destinationLayer(self) QgsVectorLayer | None[source]

Returns the destination layer to be used for storing features digitized from GPS.

Note

If destinationFollowsActiveLayer() is True then this layer will be changed whenever the user changes the active layer in the QGIS interface.

Return type:

Optional[QgsVectorLayer]

signal destinationLayerChanged[source]

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.

destinationTimeStampField(self) str[source]

Returns the destination time stamp field name for the current destinationLayer(), or an empty string if time stamps should not be automatically saved.

Return type:

str

signal destinationTimeStampFieldChanged[source]

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.

destinationTimeStampFields(self) Dict[str, str]

Returns the map of destination layer ID to target time stamp field name.

Return type:

Dict[str, str]

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.

resolveReferences(self, project: QgsProject | None)[source]

Resolves reference to layers from stored layer ID (if it has not been resolved already)

Parameters:

project (Optional[QgsProject])

setAutomaticallyAddTrackVertices(self, enabled: bool)[source]

Sets whether track vertices should be automatically created whenever new locations are received from the GPS device.

Parameters:

enabled (bool)

setAutomaticallyCommitFeatures(self, enabled: bool)[source]

Sets whether features created from GPS locations should be immediately committed to their target layers (skipping the usual layer edit buffer).

Parameters:

enabled (bool)

setDestinationFollowsActiveLayer(self, follow: bool)[source]

Sets whether the destination layer for storing features digitized from GPS should follow the current active layer automatically.

Parameters:

follow (bool)

setDestinationLayer(self, layer: QgsVectorLayer | None)[source]

Sets the destination layer to be used for storing features digitized from GPS.

Note

If destinationFollowsActiveLayer() is True then this layer will be changed whenever the user changes the active layer in the QGIS interface.

Parameters:

layer (Optional[QgsVectorLayer])

setDestinationTimeStampField(self, layer: QgsVectorLayer | None, field: str | None)[source]

Sets the destination field name for automatically storing timestamps in the specified destination layer.

Set field argument to an empty string if time stamps should not be automatically saved.

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

Returns a DOM element representing the settings.

See also

readXml()

Parameters:
Return type:

QDomElement