16#ifndef QGSPOLYMORPHICRELATION_H
17#define QGSPOLYMORPHICRELATION_H
35class QgsPolymorphicRelationPrivate;
55 Q_PROPERTY( QString
id READ
id WRITE
setId )
107 void writeXml( QDomNode &node, QDomDocument &doc ) const;
112 void setId( const QString &
id );
132 void addFieldPair( const QString &referencingField, const QString &referencedField );
151 QString
name() const;
189 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 );
226 bool isValid()
const;
240 void updateRelationStatus();
245 void setReferencedLayerField(
const QString &referencedLayerField );
250 QString referencedLayerField()
const;
255 void setReferencedLayerExpression(
const QString &expression );
260 QString referencedLayerExpression()
const;
265 void setReferencedLayerIds(
const QStringList &childRelationIds );
270 QStringList referencedLayerIds()
const;
275 QList<QgsRelation> generateRelations()
const;
296 QString upgradeGeneratedRelationId(
const QString &oldRelationId )
const;
298 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