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 )
114 mDistanceArea = distanceArea;
267 const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
268 return metaEnum.valueToKey(
static_cast<int>( mAttributeFormMode ) );
292 RelationMode mRelationMode = Undefined;
297 FormMode mFormMode = Embed;
298 bool mAllowCustomUi =
true;
299 Mode mAttributeFormMode = SingleEditMode;
This class contains context information for attribute editor widgets.
void setMapCanvas(QgsMapCanvas *mapCanvas)
Sets the associated map canvas, mapCanvas, (e.g.
RelationMode relationMode() const
Returns the attribute relation mode.
QgsAttributeEditorContext()=default
QgsMapCanvas * mapCanvas() const
Returns the associated map canvas (e.g.
FormMode formMode() const
Returns the form mode.
void setFormFeature(const QgsFeature &feature)
Set current feature for the currently edited form or table row.
void setRelation(const QgsRelation &relation, RelationMode mode)
Set attribute relation and mode.
const QgsDistanceArea & distanceArea() const
Returns the distance area object used for area/length calculations.
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
Returns the associated CAD dock widget (e.g.
QString attributeFormModeString() const
Returns given attributeFormMode as string.
RelationMode
Determines in which direction a relation was resolved.
@ Multiple
When showing a list of features (e.g. houses as an embedded form in a district form)
@ Undefined
This context is not defined by a relation.
QgsFeature parentFormFeature() const
Returns the feature of the currently edited parent form in its actual state.
const QgsVectorLayerTools * vectorLayerTools() const
Returns the associated vector layer tools.
@ Embed
A form was embedded as a widget on another form.
@ StandaloneDialog
A form was opened as a new dialog.
void setParentFormFeature(const QgsFeature &feature)
Sets the feature of the currently edited parent form.
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, const QgsRelation &relation, RelationMode relationMode, FormMode widgetMode)
void setFormMode(FormMode mode)
Sets the form mode.
QgsMessageBar * mainMessageBar()
Returns the main message bar.
void setVectorLayerTools(QgsVectorLayerTools *vlTools)
Sets the associated vector layer tools.
void setMainMessageBar(QgsMessageBar *messageBar)
Set current messageBar as the main message bar.
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, FormMode formMode)
bool allowCustomUi() const
Returns true if the attribute editor should permit use of custom UI forms.
@ SearchMode
Form values are used for searching/filtering the layer.
@ FixAttributeMode
Fix feature mode, for modifying the feature attributes without saving. The updated feature is availab...
@ SingleEditMode
Single edit mode, for editing a single feature.
@ AggregateSearchMode
Form is in aggregate search mode, show each widget in this mode.
@ MultiEditMode
Multi edit mode, for editing fields of multiple features at once.
void setAttributeFormMode(const Mode &attributeFormMode)
Set attributeFormMode for the edited form.
QgsFeature formFeature() const
Returns current feature from the currently edited form or table row.
void setAllowCustomUi(bool allow)
Sets whether the attribute editor should permit use of custom UI forms.
const QgsAttributeEditorContext * parentContext() const
const QgsRelation & relation() const
Returns the attribute relation.
Mode attributeFormMode() const
Returns current attributeFormMode.
void setDistanceArea(const QgsDistanceArea &distanceArea)
Sets distance area object, distanceArea, for area/length calculations.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
void setSourceCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets source spatial reference system crs.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Map canvas is a class for displaying all GIS data types on a canvas.
A bar for displaying non-blocking messages to the user.
static QgsProject * instance()
Returns the QgsProject singleton instance.
QgsCoordinateTransformContext transformContext
Represents a relationship between two vector layers.
Represents a vector layer which manages a vector based data sets.