66 const QString &relationName,
68 const QString &referencingLayerId,
69 const QString &referencingLayerName,
70 const QString &referencingLayerSource,
71 const QString &referencingLayerProviderKey,
72 const QString &referencedLayerId,
73 const QString &referencedLayerName,
74 const QString &referencedLayerSource,
75 const QString &referencedLayerProviderKey
88 QList< QgsRelation > resolvedRelations(
const QgsProject *project )
const;
96 QString
id()
const {
return mRelationId; }
103 QString
name()
const {
return mRelationName; }
119 QString referencingLayerSource() const;
128 QString referencingLayerProvider() const;
138 QString referencingLayerName() const;
147 void setReferencingLayer( const QString &sourceUri, const QString &provider );
163 QString referencedLayerSource() const;
172 QString referencedLayerProvider() const;
182 QString referencedLayerName() const;
191 void setReferencedLayer( const QString &sourceUri, const QString &provider );
218 QString mappingTableSource() const;
227 QString mappingTableProvider() const;
237 QString mappingTableName() const;
246 void setMappingTable( const QString &sourceUri, const QString &provider );
253 QStringList referencingLayerFields()
const {
return mReferencingLayerFields; }
456 static void writeXml(
const QgsVectorLayer *layer, WeakRelationType type,
const QgsRelation &relation, QDomNode &node, QDomDocument &doc );
459 SIP_PYOBJECT __repr__();
462 QString leftIdentifier;
463 if ( !sipCpp->referencedLayer().source.isEmpty() )
464 leftIdentifier = sipCpp->referencedLayer().source;
466 QString rightIdentifier;
467 if ( !sipCpp->referencingLayer().source.isEmpty() )
468 rightIdentifier = sipCpp->referencingLayer().source;
471 if ( leftIdentifier.isEmpty() && rightIdentifier.isEmpty() )
472 str = QStringLiteral(
"<QgsWeakRelation: %1>" ).arg( sipCpp->id() );
474 str = QStringLiteral(
"<QgsWeakRelation: %1 - %2 -> %3>" ).arg( sipCpp->id(), leftIdentifier, rightIdentifier );
476 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
487 QString mRelationName;
490 QStringList mReferencingLayerFields;
491 QStringList mMappingReferencingLayerFields;
492 QStringList mReferencedLayerFields;
493 QStringList mMappingReferencedLayerFields;
496 QString mForwardPathLabel;
497 QString mBackwardPathLabel;
498 QString mRelatedTableType;
500 friend class TestQgsWeakRelation;