16 #ifndef QGSATTRIBUTEEDITORRELATION_H
17 #define QGSATTRIBUTEEDITORRELATION_H
19 #include "qgis_core.h"
46 SaveChildEdits = 1 << 3,
47 AddChildFeature = 1 << 4,
48 DuplicateChildFeature = 1 << 5,
49 DeleteChildFeature = 1 << 6,
50 ZoomToChildFeature = 1 << 7,
51 AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature
57 Q_DECLARE_FLAGS( Buttons, Button )
65 , mRelationId( relationId )
73 , mRelationId( relation.id() )
74 , mRelation( relation )
85 , mRelationId( relationId )
96 , mRelationId( relation.id() )
97 , mRelation( relation )
122 bool forceSuppressFormPopup()
const;
130 void setForceSuppressFormPopup(
bool forceSuppressFormPopup );
136 QVariant nmRelationId()
const;
143 void setNmRelationId(
const QVariant &nmRelationId = QVariant() );
149 QString label()
const;
156 void setLabel(
const QString &label = QString() );
162 QString relationWidgetTypeId()
const;
168 void setRelationWidgetTypeId(
const QString &relationWidgetTypeId );
175 QVariantMap relationEditorConfiguration()
const;
182 void setRelationEditorConfiguration(
const QVariantMap &config );
185 void saveConfiguration( QDomElement &elem, QDomDocument &doc )
const override;
186 void loadConfiguration(
const QDomElement &element,
const QString &layerId,
const QgsReadWriteContext &context,
const QgsFields &fields )
override;
187 QString typeIdentifier()
const override;
191 Buttons mButtons = Buttons( Button::AllButtons );
193 bool mForceSuppressFormPopup =
false;
194 QVariant mNmRelationId;
196 QString mRelationWidgetTypeId;
197 QVariantMap mRelationEditorConfig;
This is an abstract base class for any elements of a drag and drop form.
virtual QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const =0
Returns a clone of this element.
This element will load a relation editor onto the form.
Q_DECL_DEPRECATED QgsAttributeEditorRelation(const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent)
const QgsRelation & relation() const
Gets the id of the relation which shall be embedded.
Button
Possible buttons shown in the relation editor.
QgsAttributeEditorRelation(const QString &relationId, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
QgsAttributeEditorRelation(const QgsRelation &relation, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
Container of fields for a vector layer.
The class is used as a container of context for various read/write operations on other objects.
This class manages a set of relations between layers.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.