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 );
151 void setStrength( RelationStrength strength );
156 void setReferencingLayer(
const QString &
id );
161 void setReferencedLayer(
const QString &
id );
171 void addFieldPair(
const QString &referencingField,
const QString &referencedField );
181 void addFieldPair(
const FieldPair &fieldPair )
SIP_SKIP;
216 QString getRelatedFeaturesFilter(
const QgsFeature &feature )
const;
255 QString name()
const;
263 RelationStrength strength()
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