23 #include "qgis_core.h" 35 class QgsRelationPrivate;
45 Q_PROPERTY( QString
id READ
id WRITE setId )
48 Q_PROPERTY( QString name READ name WRITE setName )
49 Q_PROPERTY(
bool isValid READ isValid )
81 FieldPair(
const QString &referencingField,
const QString &referencedField )
82 : QPair< QString, QString >( referencingField, referencedField ) {}
89 bool operator==(
const FieldPair &other )
const {
return first == other.first && second == other.second; }
135 void writeXml( QDomNode &node, QDomDocument &doc )
const;
140 void setId(
const QString &
id );
145 void setName(
const QString &name );
156 void setReferencingLayer(
const QString &
id );
161 void setReferencedLayer(
const QString &
id );
171 void addFieldPair(
const QString &referencingField,
const QString &referencedField );
216 QString getRelatedFeaturesFilter(
const QgsFeature &feature )
const;
255 QString name()
const;
284 QString referencingLayerId()
const;
299 QString referencedLayerId()
const;
316 QList< QgsRelation::FieldPair > fieldPairs()
const;
318 QMap< QString, QString > fieldPairs()
const;
320 const QList< QgsRelation::FieldPair > &pairs = sipCpp->fieldPairs();
321 sipRes =
new QMap< QString, QString >();
324 sipRes->insert( pair.first, pair.second );
351 bool isValid()
const;
360 bool hasEqualDefinition(
const QgsRelation &other )
const;
367 Q_INVOKABLE QString resolveReferencedField(
const QString &referencingField )
const;
374 Q_INVOKABLE QString resolveReferencingField(
const QString &referencedField )
const;
382 void updateRelationStatus();
386 mutable QExplicitlySharedDataPointer<QgsRelationPrivate> d;
395 #endif // QGSRELATION_H The class is used as a container of context for various read/write operations on other objects...
Wrapper for iterator of features from vector data provider or vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Loose relation, related elements are not part of the parent and a parent copy will not copy any child...
Defines a relation between matching fields of the two involved tables of a relation.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
bool operator==(const FieldPair &other) const
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
RelationStrength
enum for the relation strength Association, Composition
QString referencedField() const
Gets the name of the referenced (parent) field.
FieldPair(const QString &referencingField, const QString &referencedField)
Constructor which takes two fields.
QList< int > QgsAttributeList
Represents a vector layer which manages a vector based data sets.
QString referencingField() const
Gets the name of the referencing (child) field.