Class: QgsAdvancedDigitizingDockWidget¶
The QgsAdvancedDigitizingDockWidget
class is a dockable
widget used to handle the CAD tools on top of a selection of map tools.
It handles both the UI and the constraints. Constraints are applied by
implementing filters called from
QgsMapToolAdvancedDigitizing
.

QgsAdvancedDigitizingDockWidget¶
Class Hierarchy¶
Base classes¶
|
|
Methods
Adds point to the CAD point list |
|
align to segment for between line constraint. |
|
apply the CAD constraints. |
|
Returns the between line constraints which are used to place perpendicular/parallel segments to snapped segments on the canvas |
|
determines if CAD tools are enabled or if map tools behaves "nomally" |
|
Filter key events to e.g. toggle construction mode or adapt constraints. |
|
Returns the capacities |
|
Clear any cached previous clicks and helper lines |
|
Removes all points from the locked snap vertex list |
|
Removes all points from the CAD point list |
|
Returns |
|
Returns the CadConstraint on the angle |
|
Returns the CadConstraint on the distance |
|
Returns the CadConstraint |
|
Returns the CadConstraint on the M coordinate |
|
Returns the CadConstraint on the X coordinate |
|
Returns the CadConstraint |
|
Returns the CadConstraint on the Y coordinate |
|
Returns the CadConstraint on the Z coordinate |
|
Returns the vector layer within which construction guides are stored. |
|
Returns whether the construction mode is activated. |
|
The last point. |
|
Returns the last CAD point, in a map layer's coordinates. |
|
The last point. |
|
Disable the widget. |
|
Enables the tool (call this when an appropriate map tool is set and in the condition to make use of cad digitizing) Normally done automatically from |
|
Returns the action used to enable/disable the tools |
|
Returns the formatted label for common angle snapping option. |
|
Convenient method to get the M value from the line edit wiget |
|
Convenient method to get the Z value from the line edit wiget |
|
Returns on which side of the constraint line extension point, the line was created |
|
Returns the snap matches whose vertices have been locked |
|
Returns the point locator match |
|
The penultimate point. |
|
The penultimate point. |
|
The number of points in the CAD point helper list |
|
The previous point. |
|
The previous point. |
|
Processes the canvas move event. |
|
Processes the canvas press event. |
|
Processes the canvas release event. |
|
Returns whether construction guides are being recorded. |
|
unlock all constraints |
|
Removes previous point in the CAD point list |
|
Set the angle value on the widget. |
|
Set the distance value on the widget. |
|
Sets whether M is enabled |
|
Sets whether Z is enabled |
|
Set the M value on the widget. |
|
Configures list of current CAD points |
|
Sets an advanced digitizing tool which will take over digitizing until the tool is close. |
|
Set the X value on the widget. |
|
Set the Y value on the widget. |
|
Set the Z value on the widget. |
|
Returns whether the construction guides are visible. |
|
Returns whether points should snap to construction guides. |
|
Snapped to a segment |
|
Is it snapped to a vertex |
|
Returns the X value of the X soft lock. |
|
Returns the Y value of the Y soft lock. |
|
Determines if Z or M will be enabled. |
|
Toggles the distance constraint. |
|
Returns the current advanced digitizing tool. |
|
Updates canvas item that displays constraints on the ma |
|
Updates the current point in the CAD point list |
Signals
Emitted whenever CAD is enabled or disabled |
|
Emitted whenever the angle field is enabled or disabled. |
|
Emitted whenever the distance field is enabled or disabled. |
|
Emitted whenever the M field is enabled or disabled. |
|
Emitted whenever the X field is enabled or disabled. |
|
Emitted whenever the Y field is enabled or disabled. |
|
Emitted whenever the Z field is enabled or disabled. |
|
Emitted whenever the angle field should get the focus using the shortcuts (A). |
|
Emitted whenever the distance field should get the focus using the shortcuts (D). |
|
Emitted whenever the M field should get the focus using the shortcuts (M). |
|
Emitted whenever the X field should get the focus using the shortcuts (X). |
|
Emitted whenever the Y field should get the focus using the shortcuts (Y). |
|
Emitted whenever the Z field should get the focus using the shortcuts (Z). |
|
Emitted whenever the angle parameter is locked. |
|
Emitted whenever the distance parameter is locked. |
|
Emitted whenever the M parameter is locked. |
|
Emitted whenever the X parameter is locked. |
|
Emitted whenever the Y parameter is locked. |
|
Emitted whenever the Z parameter is locked. |
|
Sometimes a constraint may change the current point out of a mouse event. |
|
Sometimes a constraint may change the current point out of a mouse event. |
|
Remove any previously emitted warnings (if any) |
|
Push a warning |
|
Emitted whenever the angleX parameter is toggled between absolute and relative. |
|
Emitted whenever the M parameter is toggled between absolute and relative. |
|
Emitted whenever the X parameter is toggled between absolute and relative. |
|
Emitted whenever the Y parameter is toggled between absolute and relative. |
|
Emitted whenever the Z parameter is toggled between absolute and relative. |
|
Emitted whenever the soft line extension parameter is locked. |
|
Emitted whenever the soft x/y extension parameter is locked. |
|
Emitted whenever the angle value changes (either the mouse moved, or the user changed the input). |
|
Emitted whenever the bearing value changes. |
|
Emitted whenever the snapping to common angle option changes, angle = 0 means that the functionality is disabled. |
|
Emitted whenever the distance value changes (either the mouse moved, or the user changed the input). |
|
Emitted whenever the M value changes (either the mouse moved, or the user changed the input). |
|
Emitted whenever the X value changes (either the mouse moved, or the user changed the input). |
|
Emitted whenever the Y value changes (either the mouse moved, or the user changed the input). |
|
Emitted whenever the Z value changes (either the mouse moved, or the user changed the input). |
Attributes
- class qgis.gui.QgsAdvancedDigitizingDockWidget[source]¶
Bases:
QgsDockWidget
- __init__(canvas: QgsMapCanvas | None, parent: QWidget | None = None, userInputWidget: QgsUserInputWidget | None = None)
Create an advanced digitizing dock widget
- Parameters:
canvas (Optional[QgsMapCanvas]) – The map canvas on which the widget operates
parent (Optional[QWidget] = None) – The parent
userInputWidget (Optional[QgsUserInputWidget] = None) – The user input widget on which tools can add widget overlays on top of the map canvas (since QGIS 3.40)
- AbsoluteAngle = 1¶
- class CadCapacities¶
- class CadCapacities(f: QgsAdvancedDigitizingDockWidget.CadCapacities | QgsAdvancedDigitizingDockWidget.CadCapacity)
- class CadCapacities(a0: QgsAdvancedDigitizingDockWidget.CadCapacities)
Bases:
object
- class CadCapacity¶
Bases:
int
- class CadConstraint[source]¶
Bases:
object
The CadConstraint is a class for all basic constraints (angle/distance/x/y). It contains all values (locked, value, relative) and pointers to corresponding widgets.
Note
Relative is not mandatory since it is not used for distance.
QgsAdvancedDigitizingDockWidget.CadConstraint(lineEdit: Optional[QLineEdit], lockerButton: Optional[QToolButton], relativeButton: Optional[QToolButton] = None, repeatingLockButton: Optional[QToolButton] = None) Constructor for CadConstraint.
- Parameters:
lineEdit – associated line edit for constraint value
lockerButton – associated button for locking constraint
relativeButton – optional button for toggling relative constraint mode
repeatingLockButton – optional button for toggling repeating lock mode
QgsAdvancedDigitizingDockWidget.CadConstraint(a0: QgsAdvancedDigitizingDockWidget.CadConstraint)
- HardLock = 2¶
- class LockMode¶
Bases:
int
- NoLock = 0¶
- SoftLock = 1¶
- cadConstraintType(self) Qgis.CadConstraintType [source]¶
Returns the constraint type
Added in version 3.32.
- Return type:
- displayValue(self) str [source]¶
Returns a localized formatted string representation of the value.
Added in version 3.32.
- Return type:
str
- isRepeatingLock(self) bool [source]¶
Returns
True
if a repeating lock is set for the constraint. Repeating locks are not automatically cleared after a new point is added.See also
- Return type:
bool
- lineEdit(self) QLineEdit | None [source]¶
The line edit that manages the value of the constraint
- Return type:
Optional[QLineEdit]
- lockMode(self) QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode [source]¶
The current lock mode of this constraint
- Return type:
- Returns:
Lock mode
- precision(self) int [source]¶
Returns the numeric precision (decimal places) to show in the associated widget.
See also
Added in version 3.22.
- Return type:
int
- static removeSuffix(text: str | None, constraintType: Qgis.CadConstraintType) str [source]¶
Removes unit suffix from the constraint text.
Added in version 3.34.
- Parameters:
text (Optional[str])
constraintType (Qgis.CadConstraintType)
- Return type:
str
- setCadConstraintType(self, constraintType: Qgis.CadConstraintType)[source]¶
Sets the constraint type to
constraintType
Added in version 3.32.
- Parameters:
constraintType (Qgis.CadConstraintType)
- setLockMode(self, mode: QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode)[source]¶
Set the lock mode
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode)
- setMapCanvas(self, mapCanvas: QgsMapCanvas | None)[source]¶
Sets the map canvas to
mapCanvas
Added in version 3.32.
- Parameters:
mapCanvas (Optional[QgsMapCanvas])
- setPrecision(self, precision: int)[source]¶
Sets the numeric precision (decimal places) to show in the associated widget.
See also
Added in version 3.22.
- Parameters:
precision (int)
- setRelative(self, relative: bool)[source]¶
Set if the constraint should be treated relative
- Parameters:
relative (bool)
- setRepeatingLock(self, repeating: bool)[source]¶
Sets whether a repeating lock is set for the constraint. Repeating locks are not automatically cleared after a new point is added.
- Parameters:
repeating (bool) – set to
True
to set the lock to repeat automatically
See also
- Distance = 8¶
- FocusOut = 1¶
- RelativeAngle = 2¶
- RelativeCoordinates = 4¶
- ReturnPressed = 0¶
- TextEdited = 2¶
- class WidgetSetMode¶
Bases:
int
- addPoint(self, point: QgsPointXY)[source]¶
Adds point to the CAD point list
- Parameters:
point (QgsPointXY)
- alignToSegment(self, e: QgsMapMouseEvent | None, lockMode: QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode = QgsAdvancedDigitizingDockWidget.CadConstraint.HardLock) bool [source]¶
align to segment for between line constraint. If between line constraints are used, this will determine the angle to be locked depending on the snapped segment.
- Parameters:
e (Optional[QgsMapMouseEvent])
lockMode (QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode = QgsAdvancedDigitizingDockWidget.CadConstraint.HardLock)
- Return type:
bool
- applyConstraints(self, e: QgsMapMouseEvent | None) bool [source]¶
apply the CAD constraints. The will modify the position of the map event in map coordinates by applying the CAD constraints.
- Return type:
bool
- Returns:
False
if no solution was found (invalid constraints)- Parameters:
e (Optional[QgsMapMouseEvent])
- betweenLineConstraint(self) Qgis.BetweenLineConstraint [source]¶
Returns the between line constraints which are used to place perpendicular/parallel segments to snapped segments on the canvas
- Return type:
- cadEnabled(self) bool [source]¶
determines if CAD tools are enabled or if map tools behaves “nomally”
- Return type:
bool
- signal cadEnabledChanged(enabled: bool)[source]¶
Emitted whenever CAD is enabled or disabled
- Parameters:
enabled (bool) – Whether CAD is enabled or not
Note
unstable API (will likely change).
Added in version 3.8.
- canvasKeyPressEventFilter(self, e: QKeyEvent | None) bool [source]¶
Filter key events to e.g. toggle construction mode or adapt constraints
- Parameters:
e (Optional[QKeyEvent]) – A mouse event (may be modified)
- Return type:
bool
- Returns:
If the event is hidden (construction mode hides events from the maptool)
- capacities(self) QgsAdvancedDigitizingDockWidget.CadCapacities [source]¶
Returns the capacities
Added in version 3.26.
- Return type:
- clearLockedSnapVertices(self, force: bool = True)[source]¶
Removes all points from the locked snap vertex list
- Parameters:
force (bool = True) – Clears the list even if the constraints that use it are still locked.
Added in version 3.26.
- commonAngleConstraint(self) bool [source]¶
Returns
True
if a constraint on a common angle is active- Return type:
bool
- constraintAngle(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the angle- Return type:
- constraintDistance(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the distance- Return type:
- constraintLineExtension(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
- Return type:
- constraintM(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the M coordinateAdded in version 3.22.
- Return type:
- constraintX(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the X coordinate- Return type:
- constraintXyVertex(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
- Return type:
- constraintY(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the Y coordinate- Return type:
- constraintZ(self) QgsAdvancedDigitizingDockWidget.CadConstraint | None [source]¶
Returns the
CadConstraint
on the Z coordinateAdded in version 3.22.
- Return type:
- constructionGuidesLayer(self) QgsVectorLayer | None [source]¶
Returns the vector layer within which construction guides are stored.
Added in version 3.40.
- Return type:
Optional[QgsVectorLayer]
- constructionMode(self) bool [source]¶
Returns whether the construction mode is activated. The construction mode is used to draw intermediate points that will not be part of a geometry being digitized.
- Return type:
bool
- currentPoint(self)[source]¶
The last point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
Deprecated since version 3.22: Use
currentPointV2()
instead.
- currentPointLayerCoordinates(self, layer: QgsMapLayer | None) QgsPoint [source]¶
Returns the last CAD point, in a map
layer
’s coordinates.Added in version 3.22.
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
- currentPointV2(self)[source]¶
The last point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
Added in version 3.22.
- disable(self)[source]¶
Disable the widget. Normally done automatically from
QgsMapToolAdvancedDigitizing.deactivate()
.
- enable(self)[source]¶
Enables the tool (call this when an appropriate map tool is set and in the condition to make use of cad digitizing) Normally done automatically from
QgsMapToolAdvancedDigitizing.activate()
but may need to be fine tuned if the map tool depends on preconditions like a feature selection.
- enableAction(self) QAction | None [source]¶
Returns the action used to enable/disable the tools
- Return type:
Optional[QAction]
- signal enabledChangedAngle(enabled: bool)[source]¶
Emitted whenever the angle field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the angle parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal enabledChangedDistance(enabled: bool)[source]¶
Emitted whenever the distance field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the distance parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal enabledChangedM(enabled: bool)[source]¶
Emitted whenever the M field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the M parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.22.
- signal enabledChangedX(enabled: bool)[source]¶
Emitted whenever the X field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the X parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal enabledChangedY(enabled: bool)[source]¶
Emitted whenever the Y field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the Y parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal enabledChangedZ(enabled: bool)[source]¶
Emitted whenever the Z field is enabled or disabled. Depending on the context, some parameters do not make sense (e.g. you need a previous point to define a distance). Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
enabled (bool) – Whether the Z parameter is enabled or not.
Note
unstable API (will likely change)
Added in version 3.22.
- signal focusOnAngleRequested[source]¶
Emitted whenever the angle field should get the focus using the shortcuts (A). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.8.
- signal focusOnDistanceRequested[source]¶
Emitted whenever the distance field should get the focus using the shortcuts (D). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.8.
- signal focusOnMRequested[source]¶
Emitted whenever the M field should get the focus using the shortcuts (M). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.22.
- signal focusOnXRequested[source]¶
Emitted whenever the X field should get the focus using the shortcuts (X). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.8.
- signal focusOnYRequested[source]¶
Emitted whenever the Y field should get the focus using the shortcuts (Y). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.8.
- signal focusOnZRequested[source]¶
Emitted whenever the Z field should get the focus using the shortcuts (Z). Could be used by widgets to capture the focus when a field is being edited.
Note
unstable API (will likely change)
Added in version 3.22.
- formatCommonAngleSnapping(self, angle: float) str [source]¶
Returns the formatted label for common angle snapping option.
Added in version 3.32.
- Parameters:
angle (float)
- Return type:
str
- getLineM(self) float [source]¶
Convenient method to get the M value from the line edit wiget
Added in version 3.22.
- Return type:
float
- getLineZ(self) float [source]¶
Convenient method to get the Z value from the line edit wiget
Added in version 3.22.
- Return type:
float
- lineExtensionSide(self) Qgis.LineExtensionSide [source]¶
Returns on which side of the constraint line extension point, the line was created
- Return type:
- signal lockAngleChanged(locked: bool)[source]¶
Emitted whenever the angle parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
locked (bool)
- signal lockDistanceChanged(locked: bool)[source]¶
Emitted whenever the distance parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
locked (bool)
- signal lockMChanged(locked: bool)[source]¶
Emitted whenever the M parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.22.
- Parameters:
locked (bool)
- signal lockXChanged(locked: bool)[source]¶
Emitted whenever the X parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
locked (bool)
- signal lockYChanged(locked: bool)[source]¶
Emitted whenever the Y parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
locked (bool)
- signal lockZChanged(locked: bool)[source]¶
Emitted whenever the Z parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.22.
- Parameters:
locked (bool)
- lockedSnapVertices(self) List[QgsPointLocator.Match] ¶
Returns the snap matches whose vertices have been locked
Added in version 3.26.
- Return type:
List[QgsPointLocator.Match]
- mapPointMatch(self) QgsPointLocator.Match [source]¶
Returns the point locator match
Added in version 3.4.
- Return type:
- penultimatePoint(self)[source]¶
The penultimate point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
Deprecated since version 3.22: Use
penultimatePointV2()
instead.
- penultimatePointV2(self)[source]¶
The penultimate point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
- signal pointChanged[source]¶
Sometimes a constraint may change the current point out of a mouse event. This happens normally when a constraint is toggled.
- Parameters:
point – The last known digitizing point. Can be used to emulate a mouse event.
Deprecated since version 3.22: No longer used, will be removed in QGIS 4.0. Use pointChangedV2 instead.
- signal pointChangedV2(point: QgsPoint)[source]¶
Sometimes a constraint may change the current point out of a mouse event. This happens normally when a constraint is toggled.
- Parameters:
point (QgsPoint) – The last known digitizing point. Can be used to emulate a mouse event.
Added in version 3.22.
- previousPoint(self)[source]¶
The previous point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
Deprecated since version 3.22: Use
previousPointV2()
instead.
- previousPointV2(self)[source]¶
The previous point. Helper for the CAD point list. The CAD point list is the list of points currently digitized. It contains both “normal” points and intermediate points (construction mode).
- processCanvasMoveEvent(self, event: QgsMapMouseEvent | None)[source]¶
Processes the canvas move
event
.- Parameters:
event (Optional[QgsMapMouseEvent])
- processCanvasPressEvent(self, event: QgsMapMouseEvent | None)[source]¶
Processes the canvas press
event
.- Parameters:
event (Optional[QgsMapMouseEvent])
- processCanvasReleaseEvent(self, event: QgsMapMouseEvent | None)[source]¶
Processes the canvas release
event
.- Parameters:
event (Optional[QgsMapMouseEvent])
- signal pushWarning(message: str)[source]¶
Push a warning
- Parameters:
message (str) – An informative message
- recordConstructionGuides(self) bool [source]¶
Returns whether construction guides are being recorded.
Added in version 3.40.
- Return type:
bool
- signal relativeAngleChanged(relative: bool)[source]¶
Emitted whenever the angleX parameter is toggled between absolute and relative. Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
relative (bool) – Whether the angle parameter is relative or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal relativeMChanged(relative: bool)[source]¶
Emitted whenever the M parameter is toggled between absolute and relative. Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
relative (bool) – Whether the M parameter is relative or not.
Note
unstable API (will likely change)
Added in version 3.22.
- signal relativeXChanged(relative: bool)[source]¶
Emitted whenever the X parameter is toggled between absolute and relative. Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
relative (bool) – Whether the X parameter is relative or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal relativeYChanged(relative: bool)[source]¶
Emitted whenever the Y parameter is toggled between absolute and relative. Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
relative (bool) – Whether the Y parameter is relative or not.
Note
unstable API (will likely change)
Added in version 3.8.
- signal relativeZChanged(relative: bool)[source]¶
Emitted whenever the Z parameter is toggled between absolute and relative. Could be used by widgets that must reflect the current advanced digitizing state.
- Parameters:
relative (bool) – Whether the Z parameter is relative or not.
Note
unstable API (will likely change)
Added in version 3.22.
- releaseLocks(self, releaseRepeatingLocks: bool = True)[source]¶
unlock all constraints
- Parameters:
releaseRepeatingLocks (bool = True) – set to
False
to preserve the lock for any constraints set to repeating lock mode
- removePreviousPoint(self)[source]¶
Removes previous point in the CAD point list
Added in version 3.8.
- setAngle(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the angle value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.8.
- setDistance(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the distance value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.8.
- setEnabledM(self, enable: bool)[source]¶
Sets whether M is enabled
Added in version 3.22.
- Parameters:
enable (bool)
- setEnabledZ(self, enable: bool)[source]¶
Sets whether Z is enabled
Added in version 3.22.
- Parameters:
enable (bool)
- setM(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the M value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.22.
- setPoints(self, points: Iterable[QgsPointXY])[source]¶
Configures list of current CAD points
Some map tools may find it useful to override list of CAD points that is otherwise automatically populated when user clicks with left mouse button on map canvas.
- Parameters:
points (Iterable[QgsPointXY])
- setTool(self, tool: QgsAdvancedDigitizingTool | None)[source]¶
Sets an advanced digitizing tool which will take over digitizing until the tool is close.
Added in version 3.40.
- Parameters:
tool (Optional[QgsAdvancedDigitizingTool])
- setX(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the X value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.8.
- setY(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the Y value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.8.
- setZ(self, value: str | None, mode: QgsAdvancedDigitizingDockWidget.WidgetSetMode)[source]¶
Set the Z value on the widget. Can be used to set constraints by external widgets.
- Parameters:
mode (QgsAdvancedDigitizingDockWidget.WidgetSetMode) – What type of interaction to emulate
value (Optional[str]) – The value (as a QString, as it could be an expression)
Note
unstable API (will likely change)
Added in version 3.22.
- showConstructionGuides(self) bool [source]¶
Returns whether the construction guides are visible.
Added in version 3.40.
- Return type:
bool
- snapToConstructionGuides(self) bool [source]¶
Returns whether points should snap to construction guides.
Added in version 3.40.
- Return type:
bool
- snappedSegment(self) List[QgsPointXY] ¶
Snapped to a segment
- Return type:
List[QgsPointXY]
- signal softLockLineExtensionChanged(locked: bool)[source]¶
Emitted whenever the soft line extension parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.26.
- Parameters:
locked (bool)
- softLockX(self) float [source]¶
Returns the X value of the X soft lock. The value is NaN is the constraint isn’t magnetized to a line
- Return type:
float
- signal softLockXyChanged(locked: bool)[source]¶
Emitted whenever the soft x/y extension parameter is
locked
. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.26.
- Parameters:
locked (bool)
- softLockY(self) float [source]¶
Returns the Y value of the Y soft lock. The value is NaN is the constraint isn’t magnetized to a line
- Return type:
float
- tool(self) QgsAdvancedDigitizingTool | None [source]¶
Returns the current advanced digitizing tool. Returns
None
if not set.Added in version 3.40.
- Return type:
Optional[QgsAdvancedDigitizingTool]
- updateCurrentPoint(self, point: QgsPoint)[source]¶
Updates the current
point
in the CAD point listAdded in version 3.30.2.
- Parameters:
point (QgsPoint)
- signal valueAngleChanged(value: str)[source]¶
Emitted whenever the angle
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
value (str)
- signal valueBearingChanged(value: str)[source]¶
Emitted whenever the bearing
value
changes. Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.32.
- Parameters:
value (str)
- signal valueCommonAngleSnappingChanged(angle: float)[source]¶
Emitted whenever the snapping to common angle option changes, angle = 0 means that the functionality is disabled.
Added in version 3.32.
- Parameters:
angle (float)
- signal valueDistanceChanged(value: str)[source]¶
Emitted whenever the distance
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
value (str)
- signal valueMChanged(value: str)[source]¶
Emitted whenever the M
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.22.
- Parameters:
value (str)
- signal valueXChanged(value: str)[source]¶
Emitted whenever the X
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
value (str)
- signal valueYChanged(value: str)[source]¶
Emitted whenever the Y
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.8.
- Parameters:
value (str)
- signal valueZChanged(value: str)[source]¶
Emitted whenever the Z
value
changes (either the mouse moved, or the user changed the input). Could be used by widgets that must reflect the current advanced digitizing state.Note
unstable API (will likely change)
Added in version 3.22.
- Parameters:
value (str)