16 #ifndef QGSATTRIBUTEEDITORCONTEXT_H 17 #define QGSATTRIBUTEEDITORCONTEXT_H 78 : mParentContext( &parentContext )
79 , mVectorLayerTools( parentContext.mVectorLayerTools )
80 , mMapCanvas( parentContext.mMapCanvas )
81 , mDistanceArea( parentContext.mDistanceArea )
82 , mFormFeature( parentContext.mFormFeature )
83 , mFormMode( formMode )
89 : mParentContext( &parentContext )
90 , mVectorLayerTools( parentContext.mVectorLayerTools )
91 , mMapCanvas( parentContext.mMapCanvas )
92 , mDistanceArea( parentContext.mDistanceArea )
93 , mRelation( relation )
94 , mRelationMode( relationMode )
95 , mFormMode( widgetMode )
109 mDistanceArea = distanceArea;
241 const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
242 return metaEnum.valueToKey( static_cast<int>( mAttributeFormMode ) );
256 bool mAllowCustomUi =
true;
257 Mode mAttributeFormMode = SingleEditMode;
260 #endif // QGSATTRIBUTEEDITORCONTEXT_H
const QgsVectorLayerTools * vectorLayerTools() const
Returns the associated vector layer tools.
void setAttributeFormMode(const Mode &attributeFormMode)
Set attributeFormMode for the edited form.
Form is in aggregate search mode, show each widget in this mode.
A form was opened as a new dialog.
This class contains context information for attribute editor widgets.
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, FormMode formMode)
void setMapCanvas(QgsMapCanvas *mapCanvas)
Sets the associated map canvas, mapCanvas, (e.g.
When showing a list of features (e.g. houses as an embedded form in a district form) ...
QgsAttributeEditorContext(const QgsAttributeEditorContext &parentContext, const QgsRelation &relation, RelationMode relationMode, FormMode widgetMode)
void setVectorLayerTools(QgsVectorLayerTools *vlTools)
Sets the associated vector layer tools.
Multi edit mode, for editing fields of multiple features at once.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setAllowCustomUi(bool allow)
Sets whether the attribute editor should permit use of custom UI forms.
Map canvas is a class for displaying all GIS data types on a canvas.
void setFormFeature(const QgsFeature &feature)
Set current feature for the currently edited form or table row.
This context is not defined by a relation.
RelationMode
Determines in which direction a relation was resolved.
const QgsRelation & relation() const
Returns the attribute relation.
void setDistanceArea(const QgsDistanceArea &distanceArea)
Sets distance area object, distanceArea, for area/length calculations.
QgsFeature formFeature() const
Returns current feature from the currently edited form or table row.
Mode attributeFormMode() const
Returns current attributeFormMode.
const QgsAttributeEditorContext * parentContext() const
FormMode formMode() const
Returns the form mode.
QgsCoordinateTransformContext transformContext
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
void setFormMode(FormMode mode)
Sets the form mode.
bool allowCustomUi() const
Returns true if the attribute editor should permit use of custom UI forms.
Single edit mode, for editing a single feature.
static QgsProject * instance()
Returns the QgsProject singleton instance.
QString attributeFormModeString() const
Returns given attributeFormMode as string.
const QgsDistanceArea & distanceArea() const
Returns the distance area object used for area/length calculations.
void setSourceCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets source spatial reference system crs.
RelationMode relationMode() const
Returns the attribute relation mode.
Form values are used for searching/filtering the layer.
Represents a vector layer which manages a vector based data sets.
void setRelation(const QgsRelation &relation, RelationMode mode)
Set attribute relation and mode.
QgsMapCanvas * mapCanvas() const
Returns the associated map canvas (e.g.
A form was embedded as a widget on another form.