QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
16 #ifndef QGSATTRIBUTEEDITORCONTEXT_H
17 #define QGSATTRIBUTEEDITORCONTEXT_H
80 : mParentContext( &parentContext )
81 , mVectorLayerTools( parentContext.mVectorLayerTools )
82 , mMapCanvas( parentContext.mMapCanvas )
83 , mMainMessageBar( parentContext.mMainMessageBar )
84 , mCadDockWidget( parentContext.mCadDockWidget )
85 , mDistanceArea( parentContext.mDistanceArea )
86 , mFormFeature( parentContext.mFormFeature )
87 , mFormMode( formMode )
93 : mParentContext( &parentContext )
94 , mVectorLayerTools( parentContext.mVectorLayerTools )
95 , mMapCanvas( parentContext.mMapCanvas )
96 , mMainMessageBar( parentContext.mMainMessageBar )
97 , mCadDockWidget( parentContext.mCadDockWidget )
98 , mDistanceArea( parentContext.mDistanceArea )
99 , mRelation( relation )
100 , mRelationMode( relationMode )
101 , mFormMode( widgetMode )
115 mDistanceArea = distanceArea;
277 const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
278 return metaEnum.valueToKey(
static_cast<int>( mAttributeFormMode ) );
302 RelationMode mRelationMode = Undefined;
307 FormMode mFormMode = Embed;
308 bool mAllowCustomUi =
true;
309 Mode mAttributeFormMode = SingleEditMode;
312 #endif // QGSATTRIBUTEEDITORCONTEXT_H
QgsMapCanvas * mapCanvas() const
Returns the associated map canvas (e.g.
@ SingleEditMode
Single edit mode, for editing a single feature.
void setParentFormFeature(const QgsFeature &feature)
Sets the feature of the currently edited parent form.
bool allowCustomUi() const
Returns true if the attribute editor should permit use of custom UI forms.
void setFormMode(FormMode mode)
Sets the form mode.
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
Returns the associated CAD dock widget (e.g.
void setMainMessageBar(QgsMessageBar *messageBar)
Set current messageBar as the main message bar.
@ Undefined
This context is not defined by a relation.
RelationMode relationMode() const
Returns the attribute relation mode.
QgsCoordinateTransformContext transformContext
static QgsProject * instance()
Returns the QgsProject singleton instance.
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, FormMode formMode)
@ SearchMode
Form values are used for searching/filtering the layer.
@ Embed
A form was embedded as a widget on another form.
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, const QgsRelation &relation, RelationMode relationMode, FormMode widgetMode)
const QgsRelation & relation() const
Returns the attribute relation.
QgsFeature formFeature() const
Returns current feature from the currently edited form or table row.
Mode attributeFormMode() const
Returns current attributeFormMode.
@ StandaloneDialog
A form was opened as a new dialog.
@ MultiEditMode
Multi edit mode, for editing fields of multiple features at once.
QgsFeature parentFormFeature() const
Returns the feature of the currently edited parent form in its actual state.
void setVectorLayerTools(QgsVectorLayerTools *vlTools)
Sets the associated vector layer tools.
void setSourceCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets source spatial reference system crs.
void setDistanceArea(const QgsDistanceArea &distanceArea)
Sets distance area object, distanceArea, for area/length calculations.
FormMode formMode() const
Returns the form mode.
const QgsDistanceArea & distanceArea() const
Returns the distance area object used for area/length calculations.
RelationMode
Determines in which direction a relation was resolved.
@ AggregateSearchMode
Form is in aggregate search mode, show each widget in this mode.
void setRelation(const QgsRelation &relation, RelationMode mode)
Set attribute relation and mode.
const QgsAttributeEditorContext * parentContext() const
void setMapCanvas(QgsMapCanvas *mapCanvas)
Sets the associated map canvas, mapCanvas, (e.g.
QgsMessageBar * mainMessageBar()
Returns the main message bar.
@ Multiple
When showing a list of features (e.g. houses as an embedded form in a district form)
void setAttributeFormMode(const Mode &attributeFormMode)
Set attributeFormMode for the edited form.
const QgsVectorLayerTools * vectorLayerTools() const
Returns the associated vector layer tools.
void setAllowCustomUi(bool allow)
Sets whether the attribute editor should permit use of custom UI forms.
QString attributeFormModeString() const
Returns given attributeFormMode as string.
void setFormFeature(const QgsFeature &feature)
Set current feature for the currently edited form or table row.