Class: QgsProjectGpsSettings

class qgis.core.QgsProjectGpsSettings

Bases: PyQt5.QtCore.QObject

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

New in version 3.30.

QgsProjectGpsSettings(parent: QObject = None) Constructor for QgsProjectGpsSettings with the specified parent object.

Methods

automaticallyAddTrackVertices

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

automaticallyCommitFeatures

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

childEvent

connectNotify

customEvent

destinationFollowsActiveLayer

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

destinationLayer

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

destinationTimeStampField

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

destinationTimeStampFields

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

disconnectNotify

isSignalConnected

readXml

Reads the settings's state from a DOM element.

receivers

reset

Resets the settings to a default state.

resolveReferences

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

sender

senderSignalIndex

setAutomaticallyAddTrackVertices

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

setAutomaticallyCommitFeatures

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

setDestinationFollowsActiveLayer

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

setDestinationLayer

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

setDestinationTimeStampField

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

timerEvent

writeXml

Returns a DOM element representing the settings.

Signals

automaticallyAddTrackVerticesChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

automaticallyCommitFeaturesChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

destinationFollowsActiveLayerChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

destinationLayerChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

destinationTimeStampFieldChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

automaticallyAddTrackVertices(self) bool

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

Return type

bool

automaticallyAddTrackVerticesChanged

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

automaticallyCommitFeatures(self) bool

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

automaticallyCommitFeaturesChanged

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
destinationFollowsActiveLayer(self) bool

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

Return type

bool

destinationFollowsActiveLayerChanged

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

destinationLayer(self) QgsVectorLayer

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

QgsVectorLayer

destinationLayerChanged

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

destinationTimeStampField(self) str

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

destinationTimeStampFieldChanged

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.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

destinationTimeStampFields(self) Dict[str, str]

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

Return type

Dict[str, str]

disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
readXml(self, element: QDomElement, context: QgsReadWriteContext) bool

Reads the settings’s state from a DOM element.

See also

writeXml()

Parameters
Return type

bool

receivers(self, PYQT_SIGNAL) int
reset(self)

Resets the settings to a default state.

resolveReferences(self, project: QgsProject)

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

Parameters

project (QgsProject) –

sender(self) QObject
senderSignalIndex(self) int
setAutomaticallyAddTrackVertices(self, enabled: bool)

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

Parameters

enabled (bool) –

setAutomaticallyCommitFeatures(self, enabled: bool)

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)

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)

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 (QgsVectorLayer) –

setDestinationTimeStampField(self, layer: QgsVectorLayer, field: str)

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
timerEvent(self, QTimerEvent)
writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement

Returns a DOM element representing the settings.

See also

readXml()

Parameters
Return type

QDomElement