23 #include "qgis_core.h" 34 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; }
129 void writeXml( QDomNode &node, QDomDocument &doc )
const;
134 void setId(
const QString &
id );
139 void setName(
const QString &name );
150 void setReferencingLayer(
const QString &
id );
155 void setReferencedLayer(
const QString &
id );
165 void addFieldPair(
const QString &referencingField,
const QString &referencedField );
210 QString getRelatedFeaturesFilter(
const QgsFeature &feature )
const;
249 QString name()
const;
278 QString referencingLayerId()
const;
293 QString referencedLayerId()
const;
310 QList< QgsRelation::FieldPair > fieldPairs()
const;
312 QMap< QString, QString > fieldPairs()
const;
314 const QList< QgsRelation::FieldPair > &pairs = sipCpp->fieldPairs();
315 sipRes =
new QMap< QString, QString >();
318 sipRes->insert( pair.first, pair.second );
344 bool isValid()
const;
353 bool hasEqualDefinition(
const QgsRelation &other )
const;
360 Q_INVOKABLE QString resolveReferencedField(
const QString &referencingField )
const;
367 Q_INVOKABLE QString resolveReferencingField(
const QString &referencedField )
const;
375 void updateRelationStatus();
377 mutable QExplicitlySharedDataPointer<QgsRelationPrivate> d;
384 #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.
QString referencedField() const
Gets the name of the referenced (parent) field.
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.
QString referencingField() const
Gets the name of the referencing (child) field.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
RelationStrength
enum for the relation strength Association, Composition
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.
bool operator==(const FieldPair &other) const