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; }
120 QString referencingLayerSource() const;
129 QString referencingLayerProvider() const;
139 QString referencingLayerName() const;
148 void setReferencingLayer( const QString &sourceUri, const QString &provider );
164 QString referencedLayerSource() const;
173 QString referencedLayerProvider() const;
183 QString referencedLayerName() const;
192 void setReferencedLayer( const QString &sourceUri, const QString &provider );
219 QString mappingTableSource() const;
228 QString mappingTableProvider() const;
238 QString mappingTableName() const;
247 void setMappingTable( const QString &sourceUri, const QString &provider );
254 QStringList referencingLayerFields()
const {
return mReferencingLayerFields; }
457 static void writeXml(
const QgsVectorLayer *layer, WeakRelationType type,
const QgsRelation &relation, QDomNode &node, QDomDocument &doc );
460 SIP_PYOBJECT __repr__();
463 QString leftIdentifier;
464 if ( !sipCpp->referencedLayer().source.isEmpty() )
465 leftIdentifier = sipCpp->referencedLayer().source;
467 QString rightIdentifier;
468 if ( !sipCpp->referencingLayer().source.isEmpty() )
469 rightIdentifier = sipCpp->referencingLayer().source;
472 if ( leftIdentifier.isEmpty() && rightIdentifier.isEmpty() )
473 str = QStringLiteral(
"<QgsWeakRelation: %1>" ).arg( sipCpp->id() );
475 str = QStringLiteral(
"<QgsWeakRelation: %1 - %2 -> %3>" ).arg( sipCpp->id(), leftIdentifier, rightIdentifier );
477 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
488 QString mRelationName;
491 QStringList mReferencingLayerFields;
492 QStringList mMappingReferencingLayerFields;
493 QStringList mReferencedLayerFields;
494 QStringList mMappingReferencedLayerFields;
497 QString mForwardPathLabel;
498 QString mBackwardPathLabel;
499 QString mRelatedTableType;
501 friend class TestQgsWeakRelation;