67 const QString &relationName,
69 const QString &referencingLayerId,
70 const QString &referencingLayerName,
71 const QString &referencingLayerSource,
72 const QString &referencingLayerProviderKey,
73 const QString &referencedLayerId,
74 const QString &referencedLayerName,
75 const QString &referencedLayerSource,
76 const QString &referencedLayerProviderKey
89 QList< QgsRelation > resolvedRelations(
const QgsProject *project )
const;
97 QString
id()
const {
return mRelationId; }
104 QString
name()
const {
return mRelationName; }
118 QString referencingLayerSource() const;
125 QString referencingLayerProvider() const;
135 QString referencingLayerName() const;
149 QString referencedLayerSource() const;
156 QString referencedLayerProvider() const;
166 QString referencedLayerName() const;
191 QString mappingTableSource() const;
198 QString mappingTableProvider() const;
208 QString mappingTableName() const;
215 QStringList referencingLayerFields()
const {
return mReferencingLayerFields; }
418 static void writeXml(
const QgsVectorLayer *layer, WeakRelationType type,
const QgsRelation &relation, QDomNode &node, QDomDocument &doc );
421 SIP_PYOBJECT __repr__();
424 QString leftIdentifier;
425 if ( !sipCpp->referencedLayer().source.isEmpty() )
426 leftIdentifier = sipCpp->referencedLayer().source;
428 QString rightIdentifier;
429 if ( !sipCpp->referencingLayer().source.isEmpty() )
430 rightIdentifier = sipCpp->referencingLayer().source;
433 if ( leftIdentifier.isEmpty() && rightIdentifier.isEmpty() )
434 str = QStringLiteral(
"<QgsWeakRelation: %1>" ).arg( sipCpp->id() );
436 str = QStringLiteral(
"<QgsWeakRelation: %1 - %2 -> %3>" ).arg( sipCpp->id(), leftIdentifier, rightIdentifier );
438 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
449 QString mRelationName;
452 QStringList mReferencingLayerFields;
453 QStringList mMappingReferencingLayerFields;
454 QStringList mReferencedLayerFields;
455 QStringList mMappingReferencedLayerFields;
458 QString mForwardPathLabel;
459 QString mBackwardPathLabel;
460 QString mRelatedTableType;
462 friend class TestQgsWeakRelation;