QGIS API Documentation
2.2.0-Valmiera
|
This class manages a set of relations between layers. More...
#include <qgsrelationmanager.h>
Signals | |
void | relationsLoaded () |
Public Member Functions | |
QgsRelationManager (QgsProject *project) | |
void | setRelations (const QList< QgsRelation > &relations) |
const QMap< QString, QgsRelation > & | relations () const |
void | addRelation (const QgsRelation &relation) |
void | removeRelation (const QString &name) |
void | removeRelation (const QgsRelation &relation) |
QgsRelation | relation (const QString &id) const |
void | clear () |
QList< QgsRelation > | referencingRelations (QgsVectorLayer *layer=0, int fieldIdx=-2) const |
QList< QgsRelation > | referencedRelations (QgsVectorLayer *layer=0) const |
Private Slots | |
void | readProject (const QDomDocument &doc) |
void | writeProject (QDomDocument &doc) |
Private Attributes | |
QMap< QString, QgsRelation > | mRelations |
The references. | |
QgsProject * | mProject |
This class manages a set of relations between layers.
Definition at line 32 of file qgsrelationmanager.h.
|
explicit |
Definition at line 23 of file qgsrelationmanager.cpp.
References readProject(), and writeProject().
void QgsRelationManager::addRelation | ( | const QgsRelation & | relation | ) |
Definition at line 45 of file qgsrelationmanager.cpp.
References QgsProject::dirty(), QgsRelation::id(), QgsRelation::isValid(), mProject, mRelations, and relation().
Referenced by readProject(), and setRelations().
void QgsRelationManager::clear | ( | ) |
Definition at line 70 of file qgsrelationmanager.cpp.
References mRelations.
Referenced by QgsProject::read().
|
privateslot |
Definition at line 132 of file qgsrelationmanager.cpp.
References addRelation(), QgsRelation::createFromXML(), mRelations, QgsDebugMsg, and relationsLoaded().
Referenced by QgsRelationManager().
QList< QgsRelation > QgsRelationManager::referencedRelations | ( | QgsVectorLayer * | layer = 0 | ) | const |
Definition at line 112 of file qgsrelationmanager.cpp.
References mRelations, QgsRelation::referencedLayer(), and relations().
Referenced by QgsAttributeDialog::init().
QList< QgsRelation > QgsRelationManager::referencingRelations | ( | QgsVectorLayer * | layer = 0 , |
int | fieldIdx = -2 |
||
) | const |
Definition at line 75 of file qgsrelationmanager.cpp.
References QgsVectorLayer::fieldNameIndex(), QgsRelation::fieldPairs(), mRelations, QgsRelation::FieldPair::referencingField(), QgsRelation::referencingLayer(), and relations().
Referenced by QgsVectorLayer::referencingRelations().
QgsRelation QgsRelationManager::relation | ( | const QString & | id | ) | const |
Definition at line 65 of file qgsrelationmanager.cpp.
References mRelations.
Referenced by addRelation(), QgsAttributeDialog::init(), QgsAttributeEditorRelation::init(), and writeProject().
const QMap< QString, QgsRelation > & QgsRelationManager::relations | ( | ) | const |
Definition at line 40 of file qgsrelationmanager.cpp.
References mRelations.
Referenced by referencedRelations(), referencingRelations(), and QgsRelationManagerDialog::setLayers().
|
signal |
Referenced by readProject().
void QgsRelationManager::removeRelation | ( | const QString & | name | ) |
Definition at line 55 of file qgsrelationmanager.cpp.
References mRelations.
void QgsRelationManager::removeRelation | ( | const QgsRelation & | relation | ) |
Definition at line 60 of file qgsrelationmanager.cpp.
References QgsRelation::id(), and mRelations.
void QgsRelationManager::setRelations | ( | const QList< QgsRelation > & | relations | ) |
Definition at line 31 of file qgsrelationmanager.cpp.
References addRelation(), and mRelations.
|
privateslot |
Definition at line 155 of file qgsrelationmanager.cpp.
References mRelations, QgsDebugMsg, relation(), and QgsRelation::writeXML().
Referenced by QgsRelationManager().
|
private |
Definition at line 63 of file qgsrelationmanager.h.
Referenced by addRelation().
|
private |
The references.
Definition at line 61 of file qgsrelationmanager.h.
Referenced by addRelation(), clear(), readProject(), referencedRelations(), referencingRelations(), relation(), relations(), removeRelation(), setRelations(), and writeProject().