Class: QgsRelationEditorWidget¶
- class qgis.gui.QgsRelationEditorWidget¶
Bases:
QgsAbstractRelationEditorWidget
The default relation widget in QGIS.
New in version 3.18.
QgsRelationEditorWidget(config: Dict[str, Any], parent: QWidget = None) Constructor
- Parameters:
config – widget configuration
parent –
parent widget
Methods
Adds new features with given
geometry
- param newRelation:
- param newRelation:
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 widget, if it is wrapped within a
QgsCollapsibleGroupBox
Define the view mode for the dual view
Defines the buttons which are shown
Refresh the UI when the widget becomes visible
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 Button¶
Bases:
int
- baseClass¶
alias of
QgsRelationEditorWidget
- class Buttons¶
- class Buttons(Union[QgsRelationEditorWidget.Buttons, QgsRelationEditorWidget.Button])
- class Buttons(QgsRelationEditorWidget.Buttons)
Bases:
sip.wrapper
- baseClass¶
alias of
QgsRelationEditorWidget
- DeleteChildFeature = 64¶
- DuplicateChildFeature = 32¶
- Link = 2¶
- NoButton = 0¶
- SaveChildEdits = 8¶
- Unlink = 4¶
- ZoomToChildFeature = 128¶
- actionEvent(self, QActionEvent)¶
- addFeature(self, geometry: QgsGeometry = QgsGeometry()) object ¶
Adds new features with given
geometry
New in version 3.24.
- afterSetRelationFeature(self)¶
- afterSetRelations(self)¶
- beforeSetRelationFeature(self, newRelation: QgsRelation, newFeature: QgsFeature)¶
- Parameters:
newRelation (QgsRelation) –
newFeature (QgsFeature) –
- beforeSetRelations(self, newRelation: QgsRelation, newNmRelation: QgsRelation)¶
- Parameters:
newRelation (QgsRelation) –
newNmRelation (QgsRelation) –
- 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: PyQt5.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], PyQt5.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 widget, if it is wrapped within a
QgsCollapsibleGroupBox
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.
- setViewMode(self, mode: QgsDualView.ViewMode)¶
Define the view mode for the dual view
- Parameters:
mode (QgsDualView.ViewMode) –
- setVisibleButtons(self, buttons: QgsRelationEditorWidget.Buttons | QgsRelationEditorWidget.Button)¶
Defines the buttons which are shown
- Parameters:
buttons (Union[QgsRelationEditorWidget.Buttons) –
- showEvent(self, QShowEvent)¶
Refresh the UI when the widget becomes visible
- 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
Deprecated since version QGIS: 3.20 label is handled directly in
QgsAttributeForm
.
- updateUi(self)¶
- 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