Class: QgsMapCanvasTracer¶
-
class
qgis.gui.
QgsMapCanvasTracer
(canvas: QgsMapCanvas, messageBar: QgsMessageBar = None)¶ Bases:
qgis._core.QgsTracer
Create tracer associated with a particular map canvas, optionally message bar for reporting
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: Enums
Methods
Access to action that user may use to toggle snapping on/off.
Access to action that user may use to toggle tracing on/off.
Sets configuration from current snapping settings and canvas settings
Report a path finding error to the user
Assign “enable snapping” checkable action to the tracer.
Assign “enable tracing” checkable action to the tracer.
Retrieve instance of this class associated with given canvas (if any).
Signals
Attributes
-
actionEnableSnapping
(self) → QAction¶ Access to action that user may use to toggle snapping on/off. May be
None
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
None
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
-