Subgroup: Map

Class: QgsMapCanvasTracer

class qgis.gui.QgsMapCanvasTracer

Bases: qgis._core.QgsTracer

Extension of QgsTracer that provides extra functionality: - automatic updates of own configuration based on canvas settings - reporting of issues to the user via message bar - determines whether tracing is currently enabled by the user

A simple registry of tracer instances associated to map canvas instances is kept for convenience. (Map tools do not need to create their local tracer instances and map canvas API is not “polluted” by this optional functionality).

New in version 2.14: Methods

actionEnableSnapping Access to action that user may use to toggle snapping on/off.
actionEnableTracing Access to action that user may use to toggle tracing on/off.
blockSignals
childEvent
children
configure Sets configuration from current snapping settings and canvas settings
connectNotify
customEvent
deleteLater
destinationCrs Returns the CRS used for tracing.
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
extent Get extent to which graph’s features will be limited (empty extent means no limit)
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
findShortestPath Given two points, find the shortest path and return points on the way.
hasTopologyProblem Whether there was an error during graph creation due to noding exception,
inherits
init Build the internal data structures.
installEventFilter
invalidateGraph
isInitialized Whether the internal data structures have been initialized
isPointSnapped Find out whether the point is snapped to a vertex or edge (i.e.
isSignalConnected
isWidgetType
isWindowType
killTimer
layers Get layers used for tracing
maxFeatureCount Get maximum possible number of features in graph.
metaObject
moveToThread
objectName
offset Get offset in map units that should be applied to the traced paths returned from findShortestPath().
offsetParameters Get extra parameters for offset curve algorithm (used when offset is non-zero)
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
reportError Report a path finding error to the user
sender
senderSignalIndex
setActionEnableSnapping Assign “enable snapping” checkable action to the tracer.
setActionEnableTracing Assign “enable tracing” checkable action to the tracer.
setDestinationCrs Sets the crs and transform context used for tracing.
setExtent Set extent to which graph’s features will be limited (empty extent means no limit)
setLayers Set layers used for tracing
setMaxFeatureCount Get maximum possible number of features in graph.
setObjectName
setOffset Set offset in map units that should be applied to the traced paths returned from findShortestPath().
setOffsetParameters Set extra parameters for offset curve algorithm (used when offset is non-zero)
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr
tracerForCanvas Retrieve instance of this class associated with given canvas (if any).

Attributes

ErrNoPath
ErrNone
ErrPoint1
ErrPoint2
ErrTooManyFeatures
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
actionEnableSnapping(self) → QAction

Access to action that user may use to toggle snapping on/off. May be null if no action was associated.

New in version 3.0.

actionEnableTracing(self) → QAction

Access to action that user may use to toggle tracing on/off. May be null if no action was associated

childEvent()
configure(self)

Sets configuration from current snapping settings and canvas settings

connectNotify()
customEvent()
disconnectNotify()
invalidateGraph()
isSignalConnected()
receivers()
reportError(self, err: QgsTracer.PathError, addingVertex: bool)

Report a path finding error to the user

sender()
senderSignalIndex()
setActionEnableSnapping(self, action: QAction)

Assign “enable snapping” checkable action to the tracer. The action is used to determine whether snapping is currently enabled by the user.

New in version 3.0.

setActionEnableTracing(self, action: QAction)

Assign “enable tracing” checkable action to the tracer. The action is used to determine whether tracing is currently enabled by the user

timerEvent()
tracerForCanvas(canvas: QgsMapCanvas) → QgsMapCanvasTracer

Retrieve instance of this class associated with given canvas (if any). The class keeps a simple registry of tracers associated with map canvas instances for easier access to the common tracer by various map tools