16#ifndef QGSPOLYMORPHICRELATION_H
17#define QGSPOLYMORPHICRELATION_H
35class QgsPolymorphicRelationPrivate;
55 Q_PROPERTY( QString
id READ
id WRITE
setId )
108 void writeXml( QDomNode &node, QDomDocument &doc ) const;
113 void setId( const QString &
id );
133 void addFieldPair( const QString &referencingField, const QString &referencedField );
152 QString
name() const;
190 QList< QgsRelation::FieldPair >
fieldPairs()
const;
194 const QList< QgsRelation::FieldPair > &pairs = sipCpp->fieldPairs();
195 sipRes =
new QMap< QString, QString >();
198 sipRes->insert( pair.first, pair.second );
225 bool isValid()
const;
239 void updateRelationStatus();
244 void setReferencedLayerField(
const QString &referencedLayerField );
249 QString referencedLayerField()
const;
254 void setReferencedLayerExpression(
const QString &expression );
259 QString referencedLayerExpression()
const;
264 void setReferencedLayerIds(
const QStringList &childRelationIds );
269 QStringList referencedLayerIds()
const;
274 QList<QgsRelation> generateRelations()
const;
295 QString upgradeGeneratedRelationId(
const QString &oldRelationId )
const;
297 QExplicitlySharedDataPointer<QgsPolymorphicRelationPrivate> d;
RelationshipStrength
Relationship strength.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Wrapper for iterator of features from vector data provider or vector layer.
Wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A relation where the referenced (parent) layer is calculated based on fields from the referencing (ch...
QString referencedLayerExpression
void generateId()
Generate a (project-wide) unique id for this relation.
void setReferencingLayer(const QString &id)
Set the referencing (child) layer id.
QList< QgsRelation::FieldPair > fieldPairs() const
Returns the field pairs which form this relation The first element of each pair are the field names o...
void writeXml(QDomNode &node, QDomDocument &doc) const
Writes a relation to an XML structure.
void addFieldPair(const QString &referencingField, const QString &referencedField)
Add a field pair which is part of this relation The first element of each pair are the field names of...
friend class QgsRelationManager
static QgsPolymorphicRelation createFromXml(const QDomNode &node, QgsReadWriteContext &context, const QgsRelationContext &relationContext=QgsRelationContext())
Creates a relation from an XML structure.
QString referencingLayerId() const
Access the referencing (child) layer's id This is the layer which has the field(s) which point to ano...
QgsVectorLayer * referencingLayer
QgsPolymorphicRelation()
Default constructor.
QString referencedLayerField
void setName(const QString &name)
Set a name for this relation.
void setId(const QString &id)
Set an id for this relation.
A container for the context for various read/write operations on objects.
Defines a relation between matching fields of the two involved tables of a relation.
Represents a relationship between two vector layers.
Represents a vector layer which manages a vector based dataset.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QList< int > QgsAttributeList