QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSATTRIBUTEEDITORCONTEXT_H
17 #define QGSATTRIBUTEEDITORCONTEXT_H
81 : mParentContext( &parentContext )
82 , mVectorLayerTools( parentContext.mVectorLayerTools )
83 , mMapCanvas( parentContext.mMapCanvas )
84 , mMainMessageBar( parentContext.mMainMessageBar )
85 , mCadDockWidget( parentContext.mCadDockWidget )
86 , mDistanceArea( parentContext.mDistanceArea )
87 , mFormFeature( parentContext.mFormFeature )
88 , mFormMode( formMode )
94 : mParentContext( &parentContext )
95 , mVectorLayerTools( parentContext.mVectorLayerTools )
96 , mMapCanvas( parentContext.mMapCanvas )
97 , mMainMessageBar( parentContext.mMainMessageBar )
98 , mCadDockWidget( parentContext.mCadDockWidget )
99 , mDistanceArea( parentContext.mDistanceArea )
100 , mRelation( relation )
101 , mRelationMode( relationMode )
102 , mFormMode( widgetMode )
116 mDistanceArea = distanceArea;
278 const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
279 return metaEnum.valueToKey(
static_cast<int>( mAttributeFormMode ) );
303 RelationMode mRelationMode = Undefined;
308 FormMode mFormMode = Embed;
309 bool mAllowCustomUi =
true;
310 Mode mAttributeFormMode = SingleEditMode;
313 #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.
Map canvas is a class for displaying all GIS data types on a canvas.
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.
A bar for displaying non-blocking messages to the user.
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.
Represents a vector layer which manages a vector based data sets.
const QgsDistanceArea & distanceArea() const
Returns the distance area object used for area/length calculations.
RelationMode
Determines in which direction a relation was resolved.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
@ 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
@ FixAttributeMode
Fix feature mode, for modifying the feature attributes without saving. The updated feature is availab...
This class contains context information for attribute editor widgets. It will be passed to embedded w...
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.