Class: QgsRelationEditorWidget¶
-
class
qgis.gui.
QgsRelationEditorWidget
(config: Dict[str, Any], parent: QWidget = None)¶ Bases:
QgsAbstractRelationEditorWidget
Constructor
- Parameters
config (Dict[str) – widget configuration
parent (QWidget = None) – parent widget
The default relation widget in QGIS. Successor of the now deprecated {
QgsRelationEditorWidget
}.Methods
Adds a new feature with given
geometry
Returns the current configuration
Delete a feature with given
fid
Deletes the features with
fids
Deletes the currently selected features
Duplicates a feature
Duplicates features
Duplicates the selected features
The feature selection manager is responsible for the selected features which are currently being edited.
Links a new feature to the relation
Called when the link feature dialog is confirmed by the user
- param attribute
Saves the current modifications in the relation
Defines the current configuration
Sets the editor
context
Sets the title of the root groupbox
Define the view mode for the dual view
Defines the buttons which are shown
Toggles editing state of the widget
Unlinks a feature with given
fid
Unlinks the features with
fids
Unlinks the selected features from the relation
Updates the title contents to reflect the current state of the widget
Gets the view mode for the dual view
Returns the buttons which are shown
Zooms to the selected features
Attributes
-
AddChildFeature
= 16¶
-
AllButtons
= 254¶
-
class
Buttons
¶ Bases:
sip.wrapper
QgsRelationEditorWidget.Buttons(Union[QgsRelationEditorWidget.Buttons, QgsRelationEditorWidget.Button]) QgsRelationEditorWidget.Buttons(QgsRelationEditorWidget.Buttons)
-
baseClass
¶ alias of
qgis._gui.QgsRelationEditorWidget
-
-
DeleteChildFeature
= 64¶
-
DuplicateChildFeature
= 32¶
-
Link
= 2¶
-
SaveChildEdits
= 8¶
-
Unlink
= 4¶
-
ZoomToChildFeature
= 128¶
-
actionEvent
(self, QActionEvent)¶
-
addFeature
(self, geometry: QgsGeometry = QgsGeometry())¶ Adds a new feature with given
geometry
-
changeEvent
(self, QEvent)¶
-
childEvent
(self, QChildEvent)¶
-
closeEvent
(self, QCloseEvent)¶
-
config
(self) → Dict[str, Any]¶ Returns the current configuration
- Return type
Dict[str, Any]
-
connectNotify
(self, QMetaMethod)¶
-
contextMenuEvent
(self, QContextMenuEvent)¶
-
create
(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
-
customEvent
(self, QEvent)¶
-
deleteFeature
(self, fid: int = ::QgsFeatureId())¶ Delete a feature with given
fid
-
deleteFeatures
(self, fids: object)¶ Deletes the features with
fids
-
deleteSelectedFeatures
(self)¶ Deletes the currently selected features
-
destroy
(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dragEnterEvent
(self, QDragEnterEvent)¶
-
dragLeaveEvent
(self, QDragLeaveEvent)¶
-
dragMoveEvent
(self, QDragMoveEvent)¶
-
dropEvent
(self, QDropEvent)¶
-
duplicateFeature
(self)¶ Duplicates a feature
Deprecated since version QGIS: 3.18 use duplicateSelectedFeatures() instead
-
duplicateFeatures
(self, fids: object)¶ Duplicates features
-
duplicateSelectedFeatures
(self)¶ Duplicates the selected features
New in version 3.18.
-
enterEvent
(self, QEvent)¶
-
event
(self, QEvent) → bool¶
-
featureSelectionManager
(self) → QgsIFeatureSelectionManager¶ The feature selection manager is responsible for the selected features which are currently being edited.
- Return type
-
focusInEvent
(self, QFocusEvent)¶
-
focusNextChild
(self) → bool¶
-
focusNextPrevChild
(self, bool) → bool¶
-
focusOutEvent
(self, QFocusEvent)¶
-
focusPreviousChild
(self) → bool¶
-
hideEvent
(self, QHideEvent)¶
-
initPainter
(self, QPainter)¶
-
inputMethodEvent
(self, QInputMethodEvent)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
keyPressEvent
(self, QKeyEvent)¶
-
keyReleaseEvent
(self, QKeyEvent)¶
-
leaveEvent
(self, QEvent)¶
-
linkFeature
(self)¶ Links a new feature to the relation
-
metric
(self, QPaintDevice.PaintDeviceMetric) → int¶
-
mouseDoubleClickEvent
(self, QMouseEvent)¶
-
mouseMoveEvent
(self, QMouseEvent)¶
-
mousePressEvent
(self, QMouseEvent)¶
-
mouseReleaseEvent
(self, QMouseEvent)¶
-
moveEvent
(self, QMoveEvent)¶
-
nativeEvent
(self, Union[QByteArray, bytes, bytearray], sip.voidptr) → Tuple[bool, int]¶
-
onLinkFeatureDlgAccepted
(self)¶ Called when the link feature dialog is confirmed by the user
-
paintEvent
(self, QPaintEvent)¶
-
parentFormValueChanged
(self, attribute: str, newValue: Any)¶ - Parameters
attribute (str) –
newValue (Any) –
-
receivers
(self, PYQT_SIGNAL) → int¶
-
resizeEvent
(self, QResizeEvent)¶
-
saveEdits
(self)¶ Saves the current modifications in the relation
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setConfig
(self, config: Dict[str, Any])¶ Defines the current configuration
- Parameters
config (Dict[str) –
-
setEditorContext
(self, context: QgsAttributeEditorContext)¶ Sets the editor
context
Note
if context cadDockWidget is null, it won’t be possible to digitize the geometry of a referencing feature from this widget
- Parameters
context (QgsAttributeEditorContext) –
-
setTitle
(self, title: str)¶ Sets the title of the root groupbox
- Parameters
title (str) –
-
setViewMode
(self, mode: QgsDualView.ViewMode)¶ Define the view mode for the dual view
- Parameters
mode (QgsDualView.ViewMode) –
-
setVisibleButtons
(self, buttons: Union[QgsRelationEditorWidget.Buttons, QgsRelationEditorWidget.Button])¶ Defines the buttons which are shown
- Parameters
buttons (Union[QgsRelationEditorWidget.Buttons) –
-
showEvent
(self, QShowEvent)¶
-
tabletEvent
(self, QTabletEvent)¶
-
timerEvent
(self, QTimerEvent)¶
-
toggleEditing
(self, state: bool)¶ Toggles editing state of the widget
-
unlinkFeature
(self, fid: int = ::QgsFeatureId())¶ Unlinks a feature with given
fid
-
unlinkFeatures
(self, fids: object)¶ Unlinks the features with
fids
-
unlinkSelectedFeatures
(self)¶ Unlinks the selected features from the relation
-
updateMicroFocus
(self)¶
-
updateTitle
(self)¶ Updates the title contents to reflect the current state of the widget
-
viewMode
(self) → QgsDualView.ViewMode¶ Gets the view mode for the dual view
- Return type
-
visibleButtons
(self) → QgsRelationEditorWidget.Buttons¶ Returns the buttons which are shown
- Return type
-
wheelEvent
(self, QWheelEvent)¶
-
zoomToSelectedFeatures
(self)¶ Zooms to the selected features