23 #include "qgis_core.h" 42 Q_PROPERTY( QString
id READ
id WRITE setId )
45 Q_PROPERTY( QString name READ name WRITE setName )
46 Q_PROPERTY(
bool isValid READ isValid )
79 FieldPair(
const QString &referencingField,
const QString &referencedField )
80 : QPair< QString, QString >( referencingField, referencedField ) {}
87 bool operator==(
const FieldPair &other )
const {
return first == other.first && second == other.second; }
103 static QgsRelation createFromXml(
const QDomNode &node );
111 void writeXml( QDomNode &node, QDomDocument &doc )
const;
116 void setId(
const QString &
id );
121 void setName(
const QString &name );
132 void setReferencingLayer(
const QString &
id );
137 void setReferencedLayer(
const QString &
id );
147 void addFieldPair(
const QString &referencingField,
const QString &referencedField );
192 QString getRelatedFeaturesFilter(
const QgsFeature &feature )
const;
232 QString name()
const;
261 QString referencingLayerId()
const;
276 QString referencedLayerId()
const;
293 QList< QgsRelation::FieldPair > fieldPairs()
const;
295 QMap< QString, QString > fieldPairs()
const;
297 const QList< QgsRelation::FieldPair > &pairs = sipCpp->fieldPairs();
298 sipRes =
new QMap< QString, QString >();
301 sipRes->insert( pair.first, pair.second );
327 bool isValid()
const;
336 bool hasEqualDefinition(
const QgsRelation &other )
const;
343 Q_INVOKABLE QString resolveReferencedField(
const QString &referencingField )
const;
350 Q_INVOKABLE QString resolveReferencingField(
const QString &referencedField )
const;
358 void updateRelationStatus();
363 QString mRelationName;
365 QString mReferencingLayerId;
369 QString mReferencedLayerId;
380 QList< FieldPair > mFieldPairs;
389 #endif // QGSRELATION_H 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...
Q_DECLARE_METATYPE(QModelIndex)
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
RelationStrength
enum for the relation strength Association, Composition
QString referencedField() const
Get 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
Get the name of the referencing (child) field.