QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
The default relation widget in QGIS. More...
#include <qgsrelationeditorwidget.h>
Public Types | |
enum | Button { NoButton = 0 , Link = 1 << 1 , Unlink = 1 << 2 , SaveChildEdits = 1 << 3 , AddChildFeature = 1 << 4 , DuplicateChildFeature = 1 << 5 , DeleteChildFeature = 1 << 6 , ZoomToChildFeature = 1 << 7 , AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature } |
Possible buttons shown in the relation editor. More... | |
Public Slots | |
void | parentFormValueChanged (const QString &attribute, const QVariant &newValue) override |
Public Slots inherited from QgsAbstractRelationEditorWidget | |
virtual void | parentFormValueChanged (const QString &attribute, const QVariant &newValue)=0 |
Called when an attribute value in the parent widget has changed to newValue. More... | |
Public Member Functions | |
QgsRelationEditorWidget (const QVariantMap &config, QWidget *parent=nullptr) | |
Constructor. More... | |
QVariantMap | config () const override |
Returns the current configuration. More... | |
void | deleteSelectedFeatures () |
Deletes the currently selected features. More... | |
Q_DECL_DEPRECATED void | duplicateFeature () |
Duplicates a feature. More... | |
void | duplicateSelectedFeatures () |
Duplicates the selected features. More... | |
QgsIFeatureSelectionManager * | featureSelectionManager () |
The feature selection manager is responsible for the selected features which are currently being edited. More... | |
void | setConfig (const QVariantMap &config) override |
Defines the current configuration. More... | |
void | setEditorContext (const QgsAttributeEditorContext &context) override |
Sets the editor context. More... | |
void | setViewMode (QgsDualView::ViewMode mode) |
Define the view mode for the dual view. More... | |
void | setVisibleButtons (const Buttons &buttons) |
Defines the buttons which are shown. More... | |
void | unlinkSelectedFeatures () |
Unlinks the selected features from the relation. More... | |
QgsDualView::ViewMode | viewMode () |
Gets the view mode for the dual view. More... | |
Buttons | visibleButtons () const |
Returns the buttons which are shown. More... | |
void | zoomToSelectedFeatures () |
Zooms to the selected features. More... | |
Public Member Functions inherited from QgsAbstractRelationEditorWidget | |
QgsAbstractRelationEditorWidget (const QVariantMap &config, QWidget *parent=nullptr) | |
Constructor. More... | |
QgsAttributeEditorContext | editorContext () const |
Returns the attribute editor context. More... | |
QgsFeature | feature () const |
Returns the widget's current feature. More... | |
bool | forceSuppressFormPopup () const |
Determines the force suppress form popup status that is configured for this widget. More... | |
Q_DECL_DEPRECATED QString | label () const |
Determines the label of this element. More... | |
QgsRelation | nmRelation () const |
Returns the nm relation. More... | |
QVariant | nmRelationId () const |
Determines the relation id of the second relation involved in an N:M relation. More... | |
QgsRelation | relation () const |
Returns the relation. More... | |
void | setFeature (const QgsFeature &feature, bool update=true) |
Sets the feature being edited and updates the UI unless update is set to false . More... | |
void | setForceSuppressFormPopup (bool forceSuppressFormPopup) |
Sets force suppress form popup status with forceSuppressFormPopup configured for this widget. More... | |
void | setLabel (const QString &label=QString()) |
Sets label for this element If it's empty it takes the relation id as label. More... | |
void | setNmRelationId (const QVariant &nmRelationId=QVariant()) |
Sets nmRelationId for the relation id of the second relation involved in an N:M relation. More... | |
void | setRelationFeature (const QgsRelation &relation, const QgsFeature &feature) |
Sets the relation and the feature. More... | |
void | setRelations (const QgsRelation &relation, const QgsRelation &nmrelation) |
Sets the relation(s) for this widget If only one relation is set, it will act as a simple 1:N relation widget If both relations are set, it will act as an N:M relation widget inserting and deleting entries on the intermediate table as required. More... | |
Q_DECL_DEPRECATED void | setShowLabel (bool showLabel) |
Defines if a title label should be shown for this widget. More... | |
Q_DECL_DEPRECATED bool | showLabel () const |
Defines if a title label should be shown for this widget. More... | |
Protected Member Functions | |
void | afterSetRelationFeature () override |
A hook called right after setRelationFeature() is executed, but before updateUi() is called. More... | |
void | afterSetRelations () override |
A hook called right after setRelations() is executed, but before updateUi() is called. More... | |
void | beforeSetRelationFeature (const QgsRelation &newRelation, const QgsFeature &newFeature) override |
A hook called right before setRelationFeature() is executed. More... | |
void | beforeSetRelations (const QgsRelation &newRelation, const QgsRelation &newNmRelation) override |
A hook called right before setRelations() is executed. More... | |
virtual void | updateUi () override |
A hook called every time the state of the relation editor widget has changed via calling its set* methods or slots, e.g. More... | |
Protected Member Functions inherited from QgsAbstractRelationEditorWidget | |
void | deleteFeatures (const QgsFeatureIds &fids) |
Deletes the features with fids. More... | |
virtual Q_DECL_DEPRECATED void | setTitle (const QString &title) |
Sets the title of the widget, if it is wrapped within a QgsCollapsibleGroupBox. More... | |
void | showEvent (QShowEvent *) |
Refresh the UI when the widget becomes visible. More... | |
void | unlinkFeatures (const QgsFeatureIds &fids) |
Unlinks the features with fids. More... | |
Q_DECL_DEPRECATED void | updateTitle () |
Updates the title contents to reflect the current state of the widget. More... | |
Properties | |
QgsDualView::ViewMode | viewMode |
Buttons | visibleButtons |
Additional Inherited Members | |
Protected Slots inherited from QgsAbstractRelationEditorWidget | |
void | addFeature (const QgsGeometry &geometry=QgsGeometry()) |
Adds a new feature with given geometry. More... | |
void | deleteFeature (QgsFeatureId fid=QgsFeatureId()) |
Delete a feature with given fid. More... | |
void | duplicateFeature (const QgsFeatureId &fid) |
Duplicates a feature. More... | |
void | duplicateFeatures (const QgsFeatureIds &fids) |
Duplicates features. More... | |
void | linkFeature () |
Links a new feature to the relation. More... | |
void | onLinkFeatureDlgAccepted () |
Called when the link feature dialog is confirmed by the user. More... | |
void | saveEdits () |
Saves the current modifications in the relation. More... | |
void | toggleEditing (bool state) |
Toggles editing state of the widget. More... | |
void | unlinkFeature (QgsFeatureId fid=QgsFeatureId()) |
Unlinks a feature with given fid. More... | |
Protected Attributes inherited from QgsAbstractRelationEditorWidget | |
QgsAttributeEditorContext | mEditorContext |
QgsFeature | mFeature |
bool | mForceSuppressFormPopup = false |
bool | mLayerInSameTransactionGroup = false |
QgsRelation | mNmRelation |
QgsRelation | mRelation |
The default relation widget in QGIS.
Definition at line 87 of file qgsrelationeditorwidget.h.
Possible buttons shown in the relation editor.
Definition at line 100 of file qgsrelationeditorwidget.h.
QgsRelationEditorWidget::QgsRelationEditorWidget | ( | const QVariantMap & | config, |
QWidget * | parent = nullptr |
||
) |
Constructor.
config | widget configuration |
parent | parent widget |
Definition at line 97 of file qgsrelationeditorwidget.cpp.
|
overrideprotectedvirtual |
A hook called right after setRelationFeature() is executed, but before updateUi() is called.
Used to update the UI once setting the relation feature is done. Check QgsRealationEditorWidget as an example.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 508 of file qgsrelationeditorwidget.cpp.
|
overrideprotectedvirtual |
A hook called right after setRelations() is executed, but before updateUi() is called.
Used to update the UI once setting the relations is done. Check QgsRealationEditorWidget as an example.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 543 of file qgsrelationeditorwidget.cpp.
|
overrideprotectedvirtual |
A hook called right before setRelationFeature() is executed.
Used to update the UI once setting the relation feature is done. Check QgsRealationEditorWidget as an example.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 496 of file qgsrelationeditorwidget.cpp.
|
overrideprotectedvirtual |
A hook called right before setRelations() is executed.
Used to manipulate UI once setting the relations is done. Check QgsRealationEditorWidget as an example.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 525 of file qgsrelationeditorwidget.cpp.
|
overridevirtual |
Returns the current configuration.
Implements QgsAbstractRelationEditorWidget.
Definition at line 485 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::deleteSelectedFeatures | ( | ) |
Deletes the currently selected features.
Definition at line 580 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::duplicateFeature | ( | ) |
Duplicates a feature.
Definition at line 570 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::duplicateSelectedFeatures | ( | ) |
Duplicates the selected features.
Definition at line 575 of file qgsrelationeditorwidget.cpp.
QgsIFeatureSelectionManager * QgsRelationEditorWidget::featureSelectionManager | ( | ) |
The feature selection manager is responsible for the selected features which are currently being edited.
Definition at line 560 of file qgsrelationeditorwidget.cpp.
|
overrideslot |
Definition at line 423 of file qgsrelationeditorwidget.cpp.
|
overridevirtual |
Defines the current configuration.
Implements QgsAbstractRelationEditorWidget.
Definition at line 490 of file qgsrelationeditorwidget.cpp.
|
overridevirtual |
Sets the editor context.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 255 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::setViewMode | ( | QgsDualView::ViewMode | mode | ) |
Define the view mode for the dual view.
Definition at line 268 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::setVisibleButtons | ( | const Buttons & | buttons | ) |
Defines the buttons which are shown.
Definition at line 397 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::unlinkSelectedFeatures | ( | ) |
Unlinks the selected features from the relation.
Definition at line 565 of file qgsrelationeditorwidget.cpp.
|
overrideprotectedvirtual |
A hook called every time the state of the relation editor widget has changed via calling its set*
methods or slots, e.g.
changed relation, added feature, etc. Should be used to refresh the UI regarding the new data. Check QgsRealationEditorWidget as an example.
Reimplemented from QgsAbstractRelationEditorWidget.
Definition at line 364 of file qgsrelationeditorwidget.cpp.
|
inline |
Gets the view mode for the dual view.
Definition at line 127 of file qgsrelationeditorwidget.h.
QgsRelationEditorWidget::Buttons QgsRelationEditorWidget::visibleButtons | ( | ) | const |
Returns the buttons which are shown.
Definition at line 403 of file qgsrelationeditorwidget.cpp.
void QgsRelationEditorWidget::zoomToSelectedFeatures | ( | ) |
Zooms to the selected features.
Definition at line 586 of file qgsrelationeditorwidget.cpp.
|
readwrite |
Definition at line 1 of file qgsrelationeditorwidget.h.
|
readwrite |
Definition at line 1 of file qgsrelationeditorwidget.h.