Skip to content

Commit 741e11d

Browse files
committedFeb 20, 2017
Add missing sip bindings
1 parent 96c7fb3 commit 741e11d

File tree

1 file changed

+2
-166
lines changed

1 file changed

+2
-166
lines changed
 

‎python/core/qgsrelation.sip

Lines changed: 2 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -20,181 +20,40 @@ class QgsRelation
2020
%End
2121
public:
2222

23-
/**
24-
* Default constructor. Creates an invalid relation.
25-
*/
2623
QgsRelation();
27-
28-
/**
29-
* Creates a relation from an XML structure. Used for reading .qgs projects.
30-
*
31-
* @param node The dom node containing the relation information
32-
*
33-
* @return A relation
34-
*/
3524
static QgsRelation createFromXml( const QDomNode& node );
3625

37-
/**
38-
* Writes a relation to an XML structure. Used for saving .qgs projects
39-
*
40-
* @param node The parent node in which the relation will be created
41-
* @param doc The document in which the relation will be saved
42-
*/
4326
void writeXml( QDomNode& node, QDomDocument& doc ) const;
4427

4528
void setId( const QString& id );
4629

4730
void setName( const QString& name );
4831

49-
/**
50-
* Set the referencing (child) layer id. This layer will be searched in the registry.
51-
*
52-
* @param id
53-
*/
5432
void setReferencingLayer( const QString& id );
5533

56-
/**
57-
* Set the referenced (parent) layer id. This layer will be searched in the registry.
58-
*
59-
* @param id
60-
*/
6134
void setReferencedLayer( const QString& id );
62-
63-
/**
64-
* Add a field pairs which is part of this relation
65-
* The first element of each pair are the field names of the foreign key.
66-
* The second element of each pair are the field names of the matching primary key.
67-
*
68-
* @param referencingField The field name on the referencing (child) layer (FK)
69-
* @param referencedField The field name on the referenced (parent) layer (PK)
70-
*/
7135
void addFieldPair( const QString& referencingField, const QString& referencedField );
72-
73-
/**
74-
* Add a field pairs which is part of this relation
75-
* The first element of each pair are the field names of the foreign key.
76-
* The second element of each pair are the field names of the matching primary key.
77-
*
78-
* @param fieldPair A pair of two strings
79-
* @note not available in python bindings
80-
*/
8136
// void addFieldPair( const FieldPair& fieldPair );
8237

83-
/**
84-
* Creates an iterator which returns all the features on the referencing (child) layer
85-
* which have a foreign key pointing to the provided feature.
86-
*
87-
* @param feature A feature from the referenced (parent) layer
88-
*
89-
* @return An iterator with all the referenced features
90-
* @see getRelatedFeaturesRequest()
91-
* @see getRelatedFeaturesFilter()
92-
*/
9338
QgsFeatureIterator getRelatedFeatures( const QgsFeature& feature ) const;
9439

95-
/**
96-
* Creates a request to return all the features on the referencing (child) layer
97-
* which have a foreign key pointing to the provided feature.
98-
*
99-
* @param feature A feature from the referenced (parent) layer
100-
*
101-
* @return A request for all the referencing features
102-
* @see getRelatedFeatures()
103-
* @see getRelatedFeaturesFilter()
104-
*/
10540
QgsFeatureRequest getRelatedFeaturesRequest( const QgsFeature& feature ) const;
106-
107-
/** Returns a filter expression which returns all the features on the referencing (child) layer
108-
* which have a foreign key pointing to the provided feature.
109-
* @param feature A feature from the referenced (parent) layer
110-
* @return expression filter string for all the referencing features
111-
* @note added in QGIS 2.16
112-
* @see getRelatedFeatures()
113-
* @see getRelatedFeaturesRequest()
114-
*/
11541
QString getRelatedFeaturesFilter( const QgsFeature& feature ) const;
116-
117-
/**
118-
* Creates a request to return the feature on the referenced (parent) layer
119-
* which is referenced by the provided feature.
120-
*
121-
* @param attributes An attribute vector containing the foreign key
122-
*
123-
* @return A request the referenced feature
124-
* @note not available in python bindings
125-
*/
12642
QgsFeatureRequest getReferencedFeatureRequest( const QgsAttributes& attributes ) const;
127-
128-
/**
129-
* Creates a request to return the feature on the referenced (parent) layer
130-
* which is referenced by the provided feature.
131-
*
132-
* @param feature A feature from the referencing (child) layer
133-
*
134-
* @return A request the referenced feature
135-
*/
13643
QgsFeatureRequest getReferencedFeatureRequest( const QgsFeature& feature ) const;
137-
138-
/**
139-
* Creates a request to return the feature on the referenced (parent) layer
140-
* which is referenced by the provided feature.
141-
*
142-
* @param feature A feature from the referencing (child) layer
143-
*
144-
* @return A request the referenced feature
145-
*/
14644
QgsFeature getReferencedFeature( const QgsFeature& feature ) const;
147-
148-
/**
149-
* Returns a human readable name for this relation. Mostly used as title for the children.
150-
*
151-
* @see id()
152-
*
153-
* @return A name
154-
*/
15545
QString name() const;
15646

157-
/**
158-
* A (project-wide) unique id for this relation
159-
*
160-
* @return The id
161-
*/
16247
QString id() const;
16348

164-
/**
165-
* Generate a (project-wide) unique id for this relation
166-
* @note added in QGIS 3.0
167-
*/
16849
void generateId();
16950

170-
/**
171-
* Access the referencing (child) layer's id
172-
* This is the layer which has the field(s) which point to another layer
173-
*
174-
* @return The id of the referencing layer
175-
*/
17651
QString referencingLayerId() const;
17752

178-
/**
179-
* Access the referencing (child) layer
180-
* This is the layer which has the field(s) which point to another layer
181-
*
182-
* @return The referencing layer
183-
*/
18453
QgsVectorLayer* referencingLayer() const;
18554

186-
/**
187-
* Access the referenced (parent) layer's id
188-
*
189-
* @return The id of the referenced layer
190-
*/
19155
QString referencedLayerId() const;
19256

193-
/**
194-
* Access the referenced (parent) layer
195-
*
196-
* @return referenced layer
197-
*/
19857
QgsVectorLayer* referencedLayer() const;
19958

20059
/**
@@ -214,36 +73,13 @@ class QgsRelation
21473
}
21574
%End
21675

217-
/**
218-
* Returns a list of attributes used to form the referenced fields
219-
* (most likely primary key) on the referenced (parent) layer.
220-
*
221-
* @return A list of attributes
222-
*/
22376
QgsAttributeList referencedFields() const;
22477

225-
/**
226-
* Returns a list of attributes used to form the referencing fields
227-
* (foreign key) on the referencing (child) layer.
228-
*
229-
* @return A list of attributes
230-
*/
23178
QgsAttributeList referencingFields() const;
23279

233-
/**
234-
* Returns the validity of this relation. Don't use the information if it's not valid.
235-
*
236-
* @return true if the relation is valid
237-
*/
23880
bool isValid() const;
239-
240-
/**
241-
* Compares the two QgsRelation, ignoring the name and the ID.
242-
*
243-
* @param other The other relation
244-
* @return true if they are similar
245-
* @note added in QGIS 3.0
246-
*/
24781
bool hasEqualDefinition( const QgsRelation& other ) const;
24882

83+
QString resolveReferencedField( const QString& referencingField ) const;
84+
QString resolveReferencingField( const QString& referencedField ) const;
24985
};

0 commit comments

Comments
 (0)
Please sign in to comment.