Subgroup: Advanced
Class: QgsAdvancedDigitizingDockWidget¶
-
class
qgis.gui.
QgsAdvancedDigitizingDockWidget
¶ Bases:
qgis._gui.QgsDockWidget
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.
Methods
acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
addPoint
Adds point to the CAD point list additionalConstraint
Additional constraints are used to place perpendicular/parallel segments to snapped segments on the canvas adjustSize
alignToSegment
align to segment for additional constraint. allowedAreas
applyConstraints
apply the CAD constraints. The will modify the position of the map event in map coordinates by applying the CAD constraints. autoFillBackground
backgroundRole
baseSize
blockSignals
cadEnabled
determines if CAD tools are enabled or if map tools behaves “nomally” canvasKeyPressEventFilter
Filter key events to e.g. changeEvent
childAt
childAt(self, int, int) -> QWidget childEvent
children
childrenRect
childrenRegion
clear
Clear any cached previous clicks and helper lines clearFocus
clearMask
clearPoints
Removes all points from the CAD point list close
closeEvent
colorCount
commonAngleConstraint
Constraint on a common angle connectNotify
constraintAngle
Constraint on the angle constraintDistance
Constraint on the distance constraintX
Constraint on the X coordinate constraintY
Constraint on the Y coordinate constructionMode
construction mode is used to draw intermediate points. These points won’t be given any further (i.e. to the map tools) contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
create
createWindowContainer
currentPoint
The last point. cursor
customEvent
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disable
Disable the widget. disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
enable
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
return the action used to enable/disable the tools ensurePolished
enterEvent
event
eventFilter
features
find
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] focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse
grabMouse(self, Union[QCursor, Qt.CursorShape]) grabShortcut
graphicsEffect
graphicsProxyWidget
hasFocus
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
Disables the CAD tools when hiding the dock inherits
initPainter
initStyleOption
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isAreaAllowed
isEnabled
isEnabledTo
isFloating
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isUserVisible
Returns true if the dock is both opened and raised to the front (ie not hidden by any other tabs. isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move
move(self, int, int) moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
penultimatePoint
The penultimate point. physicalDpiX
physicalDpiY
pointsCount
The number of points in the CAD point helper list pos
previousInFocusChain
previousPoint
The previous point. property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. raise_
receivers
rect
releaseKeyboard
releaseLocks
unlock all constraints releaseMouse
releaseShortcut
removeAction
removeEventFilter
render
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren)) repaint
repaint(self, int, int, int, int) resize
resize(self, int, int) resizeEvent
restoreGeometry
saveGeometry
scroll
scroll(self, int, int, QRect) sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAllowedAreas
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize
setBaseSize(self, QSize) setContentsMargins
setContentsMargins(self, QMargins) setContextMenuPolicy
setCursor
setDisabled
setEnabled
setFeatures
setFixedHeight
setFixedSize
setFixedSize(self, int, int) setFixedWidth
setFloating
setFocus
setFocus(self, Qt.FocusReason) setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setGeometry
setGeometry(self, int, int, int, int) setGraphicsEffect
setHidden
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask
setMask(self, QRegion) setMaximumHeight
setMaximumSize
setMaximumSize(self, QSize) setMaximumWidth
setMinimumHeight
setMinimumSize
setMinimumSize(self, QSize) setMinimumWidth
setMouseTracking
setObjectName
setPalette
setParent
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) setPoints
Configures list of current CAD points setProperty
setShortcutAutoRepeat
setShortcutEnabled
setSizeIncrement
setSizeIncrement(self, QSize) setSizePolicy
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setTitleBarWidget
setToolTip
setToolTipDuration
setUpdatesEnabled
setUserVisible
Sets the dock widget as visible to a user, ie both shown and raised to the front. setVisible
setWhatsThis
setWidget
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
snappedSegment
Snapped to a segment snappedToVertex
Is it snapped to a vertex stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
titleBarWidget
toggleViewAction
toolTip
toolTipDuration
tr
underMouse
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update
update(self, QRect) updateCadPaintItem
Updates canvas item that displays constraints on the ma updateGeometry
updateMicroFocus
updatesEnabled
visibleRegion
whatsThis
wheelEvent
widget
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y
Attributes
AbsoluteAngle
AllDockWidgetFeatures
DockWidgetClosable
DockWidgetFloatable
DockWidgetMovable
DockWidgetVerticalTitleBar
DrawChildren
DrawWindowBackground
IgnoreMask
NoConstraint
NoDockWidgetFeatures
Parallel
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
Perpendicular
RelativeAngle
RelativeCoordinates
closed
Emitted when dock widget is closed. closedStateChanged
Emitted when dock widget is closed (or opened). customContextMenuRequested
customContextMenuRequested(self, QPoint) [signal] destroyed
destroyed(self, QObject = None) [signal] featuresChanged
featuresChanged(self, Union[QDockWidget.DockWidgetFeatures, QDockWidget.DockWidgetFeature]) [signal] objectNameChanged
objectNameChanged(self, str) [signal] opened
Emitted when dock widget is opened. openedStateChanged
Emitted when dock widget is opened (or closed). pointChanged
Sometimes a constraint may change the current point out of a mouse event. popWarning
Remove any previously emitted warnings (if any) [signal] pushWarning
Push a warning staticMetaObject
topLevelChanged
topLevelChanged(self, bool) [signal] visibilityChanged
visibilityChanged(self, bool) [signal] windowIconChanged
windowIconChanged(self, QIcon) [signal] windowIconTextChanged
windowIconTextChanged(self, str) [signal] windowTitleChanged
windowTitleChanged(self, str) [signal] -
AbsoluteAngle
= 1¶
-
class
AdditionalConstraint
¶ Bases:
int
-
class
CadCapacities
¶ Bases:
sip.wrapper
QgsAdvancedDigitizingDockWidget.CadCapacities(Union[QgsAdvancedDigitizingDockWidget.CadCapacities, QgsAdvancedDigitizingDockWidget.CadCapacity]) QgsAdvancedDigitizingDockWidget.CadCapacities(QgsAdvancedDigitizingDockWidget.CadCapacities)
-
class
CadCapacity
¶ Bases:
int
-
class
CadConstraint
¶ Bases:
sip.wrapper
The CadConstraint is an abstract 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.
-
HardLock
= 2¶
-
class
LockMode
¶ Bases:
int
-
NoLock
= 0¶
-
SoftLock
= 1¶
-
isLocked
(self) → bool¶ Is any kind of lock mode enabled
-
isRepeatingLock
(self) → bool¶ Returns true if a repeating lock is set for the constraint. Repeating locks are not automatically cleared after a new point is added.
New in version 2.16.
See also
-
lineEdit
(self) → QLineEdit¶ The line edit that manages the value of the constraint
-
lockMode
(self) → QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode¶ The current lock mode of this constraint
Returns: Lock mode
-
relative
(self) → bool¶ Is the constraint in relative mode
-
setLockMode
(self, mode: QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode)¶ Set the lock mode
-
setRelative
(self, relative: bool)¶ Set if the constraint should be treated relative
-
setRepeatingLock
(self, repeating: bool)¶ Sets whether a repeating lock is set for the constraint. Repeating locks are not automatically cleared after a new point is added.
Parameters: repeating – set to true to set the lock to repeat automatically New in version 2.16.
See also
-
setValue
(self, value: float, updateWidget: bool = True)¶ Set the value of the constraint
Parameters: - value – new value for constraint
- updateWidget – set to false to prevent automatically updating the associated widget’s value
-
toggleLocked
(self)¶ Toggle lock mode
-
toggleRelative
(self)¶ Toggle relative mode
-
value
(self) → float¶ The value of the constraint
-
-
NoConstraint
= 0¶
-
Parallel
= 2¶
-
Perpendicular
= 1¶
-
RelativeAngle
= 2¶
-
RelativeCoordinates
= 4¶
-
actionEvent
()¶
-
addPoint
(self, point: QgsPointXY)¶ Adds point to the CAD point list
New in version 3.0.
-
additionalConstraint
(self) → QgsAdvancedDigitizingDockWidget.AdditionalConstraint¶ Additional constraints are used to place perpendicular/parallel segments to snapped segments on the canvas
-
alignToSegment
(self, e: QgsMapMouseEvent, lockMode: QgsAdvancedDigitizingDockWidget.CadConstraint.LockMode = QgsAdvancedDigitizingDockWidget.CadConstraint.HardLock) → bool¶ align to segment for additional constraint. If additional constraints are used, this will determine the angle to be locked depending on the snapped segment.
New in version 3.0.
-
applyConstraints
(self, e: QgsMapMouseEvent) → bool¶ apply the CAD constraints. The will modify the position of the map event in map coordinates by applying the CAD constraints.
Returns: false if no solution was found (invalid constraints)
-
cadEnabled
(self) → bool¶ determines if CAD tools are enabled or if map tools behaves “nomally”
-
canvasKeyPressEventFilter
(self, e: QKeyEvent) → bool¶ Filter key events to e.g. toggle construction mode or adapt constraints
Parameters: e – A mouse event (may be modified) Returns: If the event is hidden (construction mode hides events from the maptool)
-
changeEvent
()¶
-
childEvent
()¶
-
clear
(self)¶ Clear any cached previous clicks and helper lines
-
clearPoints
(self)¶ Removes all points from the CAD point list
New in version 3.0.
-
closeEvent
()¶
-
commonAngleConstraint
(self) → bool¶ Constraint on a common angle
-
connectNotify
()¶
-
constraintAngle
(self) → QgsAdvancedDigitizingDockWidget.CadConstraint¶ Constraint on the angle
-
constraintDistance
(self) → QgsAdvancedDigitizingDockWidget.CadConstraint¶ Constraint on the distance
-
constraintX
(self) → QgsAdvancedDigitizingDockWidget.CadConstraint¶ Constraint on the X coordinate
-
constraintY
(self) → QgsAdvancedDigitizingDockWidget.CadConstraint¶ Constraint on the Y coordinate
-
constructionMode
(self) → bool¶ construction mode is used to draw intermediate points. These points won’t be given any further (i.e. to the map tools)
-
contextMenuEvent
()¶
-
create
()¶
-
currentPoint
(self) → Tuple[QgsPointXY, bool]¶ 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).
-
customEvent
()¶
-
destroy
()¶
-
disable
(self)¶ Disable the widget. Normally done automatically from
QgsMapToolAdvancedDigitizing.deactivate()
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enable
(self)¶ 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¶ return the action used to enable/disable the tools
-
enterEvent
()¶
-
event
()¶
-
eventFilter
()¶
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
(self, QHideEvent)¶ Disables the CAD tools when hiding the dock
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
(self, e: QKeyEvent)¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
penultimatePoint
(self) → Tuple[QgsPointXY, bool]¶ 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).
-
pointChanged
¶ 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. [signal]
-
pointsCount
(self) → int¶ The number of points in the CAD point helper list
-
popWarning
¶ Remove any previously emitted warnings (if any) [signal]
-
previousPoint
(self) → Tuple[QgsPointXY, bool]¶ 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).
-
pushWarning
¶ Push a warning
Parameters: message – An informative message [signal]
-
receivers
()¶
-
releaseLocks
(self, releaseRepeatingLocks: bool = True)¶ unlock all constraints
Parameters: releaseRepeatingLocks – set to false to preserve the lock for any constraints set to repeating lock mode New in version 3.0.
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setPoints
(self, points: Iterable[QgsPointXY])¶ 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.
New in version 3.0.
-
showEvent
()¶
-
snappedSegment
(self) → List[QgsPointXY]¶ Snapped to a segment
-
snappedToVertex
(self) → bool¶ Is it snapped to a vertex
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateCadPaintItem
(self)¶ Updates canvas item that displays constraints on the ma
New in version 3.0.
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-