8
8
9
9
10
10
11
-
12
- class QgsFeatureFilterModel : QAbstractItemModel
11
+ class QgsFeatureFilterModel : QgsFeaturePickerModelBase
13
12
{
14
13
%Docstring
15
14
Provides a list of features based on filter conditions.
@@ -23,85 +22,9 @@ Features are fetched asynchronously.
23
22
%End
24
23
public:
25
24
26
- enum Role
27
- {
28
- IdentifierValueRole,
29
- IdentifierValuesRole,
30
- ValueRole
31
- };
32
-
33
25
explicit QgsFeatureFilterModel( QObject *parent = 0 );
34
26
%Docstring
35
27
Create a new QgsFeatureFilterModel, optionally specifying a ``parent``.
36
- %End
37
- ~QgsFeatureFilterModel();
38
-
39
- QgsVectorLayer *sourceLayer() const;
40
- %Docstring
41
- The source layer from which features will be fetched.
42
- %End
43
-
44
- void setSourceLayer( QgsVectorLayer *sourceLayer );
45
- %Docstring
46
- The source layer from which features will be fetched.
47
- %End
48
-
49
- QString displayExpression() const;
50
- %Docstring
51
- The display expression will be used for
52
-
53
- - displaying values in the combobox
54
- - filtering based on filterValue
55
- %End
56
-
57
- void setDisplayExpression( const QString &displayExpression );
58
- %Docstring
59
- The display expression will be used for
60
-
61
- - displaying values in the combobox
62
- - filtering based on filterValue
63
- %End
64
-
65
- QString filterValue() const;
66
- %Docstring
67
- This value will be used to filter the features available from
68
- this model. Whenever a substring of the displayExpression of a feature
69
- matches the filter value, it will be accessible by this model.
70
- %End
71
-
72
- void setFilterValue( const QString &filterValue );
73
- %Docstring
74
- This value will be used to filter the features available from
75
- this model. Whenever a substring of the displayExpression of a feature
76
- matches the filter value, it will be accessible by this model.
77
- %End
78
-
79
- virtual QModelIndex index( int row, int column, const QModelIndex &parent ) const;
80
-
81
- virtual QModelIndex parent( const QModelIndex &child ) const;
82
-
83
- virtual int rowCount( const QModelIndex &parent ) const;
84
-
85
- virtual int columnCount( const QModelIndex &parent ) const;
86
-
87
- virtual QVariant data( const QModelIndex &index, int role ) const;
88
-
89
-
90
- QString filterExpression() const;
91
- %Docstring
92
- An additional filter expression to apply, next to the filterValue.
93
- Can be used for spatial filtering etc.
94
- %End
95
-
96
- void setFilterExpression( const QString &filterExpression );
97
- %Docstring
98
- An additional filter expression to apply, next to the filterValue.
99
- Can be used for spatial filtering etc.
100
- %End
101
-
102
- bool isLoading() const;
103
- %Docstring
104
- Indicator if the model is currently performing any feature iteration in the background.
105
28
%End
106
29
107
30
QString identifierField() const;
@@ -120,14 +43,6 @@ The identifier field should be a unique field that can be used to identify indiv
120
43
It is normally set to the primary key of the layer.
121
44
122
45
.. versionadded:: 3.10
123
- %End
124
-
125
- void setIdentifierField( const QString &identifierField );
126
- %Docstring
127
- The identifier field should be a unique field that can be used to identify individual features.
128
- It is normally set to the primary key of the layer.
129
-
130
- .. deprecated:: QGIS 3.10
131
46
%End
132
47
133
48
void setIdentifierFields( const QStringList &identifierFields );
@@ -142,28 +57,21 @@ It is normally set to the primary key of the layer.
142
57
.. versionadded:: 3.10
143
58
%End
144
59
145
- QVariant extraIdentifierValue() const;
146
- %Docstring
147
- Allows specifying one value that does not need to match the filter criteria but will
148
- still be available in the model.
60
+ virtual void setExtraIdentifierValueToNull();
149
61
150
- .. deprecated:: QGIS 3.10
151
- %End
152
-
153
- QVariantList extraIdentifierValues() const;
154
62
%Docstring
155
63
Allows specifying one value that does not need to match the filter criteria but will
156
- still be available in the model.
64
+ still be available in the model as NULL value(s) .
157
65
158
66
.. versionadded:: 3.10
159
67
%End
160
68
161
- void setExtraIdentifierValue( const QVariant &extraIdentifierValue ) ;
69
+ QVariantList extraIdentifierValues() const ;
162
70
%Docstring
163
71
Allows specifying one value that does not need to match the filter criteria but will
164
72
still be available in the model.
165
73
166
- .. deprecated:: QGIS 3.10
74
+ .. versionadded:: 3.10
167
75
%End
168
76
169
77
void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
@@ -174,107 +82,19 @@ still be available in the model.
174
82
.. versionadded:: 3.10
175
83
%End
176
84
177
- void setExtraIdentifierValuesToNull();
178
- %Docstring
179
- Allows specifying one value that does not need to match the filter criteria but will
180
- still be available in the model as NULL value(s).
181
-
182
- .. versionadded:: 3.10
183
- %End
184
-
185
- int extraIdentifierValueIndex() const;
186
- %Docstring
187
- The index at which the extra identifier value is available within the model.
188
- %End
189
-
190
- bool extraValueDoesNotExist() const;
191
- %Docstring
192
- Flag indicating that the extraIdentifierValue does not exist in the data.
193
- %End
194
-
195
- bool allowNull() const;
196
- %Docstring
197
- Add a NULL entry to the list.
198
- %End
199
-
200
- void setAllowNull( bool allowNull );
201
- %Docstring
202
- Add a NULL entry to the list.
203
- %End
204
85
205
86
signals:
206
87
207
- void sourceLayerChanged();
208
- %Docstring
209
- The source layer from which features will be fetched.
210
- %End
211
-
212
- void displayExpressionChanged();
213
- %Docstring
214
- The display expression will be used for
215
-
216
- - displaying values in the combobox
217
- - filtering based on filterValue
218
- %End
219
-
220
- void filterValueChanged();
221
- %Docstring
222
- This value will be used to filter the features available from
223
- this model. Whenever a substring of the displayExpression of a feature
224
- matches the filter value, it will be accessible by this model.
225
- %End
226
-
227
- void filterExpressionChanged();
228
- %Docstring
229
- An additional filter expression to apply, next to the filterValue.
230
- Can be used for spatial filtering etc.
231
- %End
232
-
233
- void isLoadingChanged();
234
- %Docstring
235
- Indicator if the model is currently performing any feature iteration in the background.
236
- %End
237
-
238
- void identifierFieldChanged();
88
+ void identifierFieldsChanged();
239
89
%Docstring
240
90
The identifier field should be a unique field that can be used to identify individual features.
241
91
It is normally set to the primary key of the layer.
242
92
%End
243
93
244
- void filterJobCompleted();
245
- %Docstring
246
- Indicates that a filter job has been completed and new data may be available.
247
- %End
248
-
249
- void extraIdentifierValueChanged();
94
+ void extraIdentifierValuesChanged();
250
95
%Docstring
251
96
Allows specifying one value that does not need to match the filter criteria but will
252
97
still be available in the model.
253
- %End
254
-
255
- void extraIdentifierValueIndexChanged( int index );
256
- %Docstring
257
- The index at which the extra identifier value is available within the model.
258
- %End
259
-
260
- void extraValueDoesNotExistChanged();
261
- %Docstring
262
- Flag indicating that the extraIdentifierValue does not exist in the data.
263
- %End
264
-
265
- void beginUpdate();
266
- %Docstring
267
- Notification that the model is about to be changed because a job was completed.
268
- %End
269
-
270
- void endUpdate();
271
- %Docstring
272
- Notification that the model change is finished. Will always be emitted in sync with beginUpdate.
273
- %End
274
-
275
- void allowNullChanged();
276
- %Docstring
277
- Add a NULL entry to the list.
278
98
%End
279
99
280
100
};
0 commit comments