Skip to content

Commit 578ab85

Browse files
authoredApr 30, 2020
Merge pull request #36089 from 3nids/expression-preview
Feature browser for preview in expression builder
2 parents 9d5b69a + d7edbcb commit 578ab85

28 files changed

+3098
-1236
lines changed
 

‎python/core/auto_generated/qgsfeaturefiltermodel.sip.in

Lines changed: 7 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99

1010

11-
12-
class QgsFeatureFilterModel : QAbstractItemModel
11+
class QgsFeatureFilterModel : QgsFeaturePickerModelBase
1312
{
1413
%Docstring
1514
Provides a list of features based on filter conditions.
@@ -23,85 +22,9 @@ Features are fetched asynchronously.
2322
%End
2423
public:
2524

26-
enum Role
27-
{
28-
IdentifierValueRole,
29-
IdentifierValuesRole,
30-
ValueRole
31-
};
32-
3325
explicit QgsFeatureFilterModel( QObject *parent = 0 );
3426
%Docstring
3527
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.
10528
%End
10629

10730
QString identifierField() const;
@@ -120,14 +43,6 @@ The identifier field should be a unique field that can be used to identify indiv
12043
It is normally set to the primary key of the layer.
12144

12245
.. 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
13146
%End
13247

13348
void setIdentifierFields( const QStringList &identifierFields );
@@ -142,28 +57,21 @@ It is normally set to the primary key of the layer.
14257
.. versionadded:: 3.10
14358
%End
14459

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();
14961

150-
.. deprecated:: QGIS 3.10
151-
%End
152-
153-
QVariantList extraIdentifierValues() const;
15462
%Docstring
15563
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).
15765

15866
.. versionadded:: 3.10
15967
%End
16068

161-
void setExtraIdentifierValue( const QVariant &extraIdentifierValue );
69+
QVariantList extraIdentifierValues() const;
16270
%Docstring
16371
Allows specifying one value that does not need to match the filter criteria but will
16472
still be available in the model.
16573

166-
.. deprecated:: QGIS 3.10
74+
.. versionadded:: 3.10
16775
%End
16876

16977
void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
@@ -174,107 +82,19 @@ still be available in the model.
17482
.. versionadded:: 3.10
17583
%End
17684

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
20485

20586
signals:
20687

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();
23989
%Docstring
24090
The identifier field should be a unique field that can be used to identify individual features.
24191
It is normally set to the primary key of the layer.
24292
%End
24393

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();
25095
%Docstring
25196
Allows specifying one value that does not need to match the filter criteria but will
25297
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.
27898
%End
27999

280100
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsfeaturepickermodel.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
class QgsFeaturePickerModel : QgsFeaturePickerModelBase
12+
{
13+
%Docstring
14+
Provides a list of features based on filter conditions.
15+
Features are fetched asynchronously.
16+
17+
.. versionadded:: 3.0
18+
%End
19+
20+
%TypeHeaderCode
21+
#include "qgsfeaturepickermodel.h"
22+
%End
23+
public:
24+
25+
explicit QgsFeaturePickerModel( QObject *parent = 0 );
26+
%Docstring
27+
Create a new QgsFeaturePickerModel, optionally specifying a ``parent``.
28+
%End
29+
30+
virtual void setExtraIdentifierValueToNull();
31+
32+
%Docstring
33+
Allows specifying one value that does not need to match the filter criteria but will
34+
still be available in the model as NULL value(s).
35+
36+
.. versionadded:: 3.10
37+
%End
38+
39+
void setFeature( const QgsFeatureId &fid );
40+
%Docstring
41+
Set the feature to the given feature id
42+
%End
43+
44+
QgsFeature feature() const;
45+
%Docstring
46+
Returns the current feature
47+
%End
48+
49+
signals:
50+
void featureChanged( const QgsFeature &feature );
51+
%Docstring
52+
Emitted when the current feature changes
53+
%End
54+
55+
56+
};
57+
58+
/************************************************************************
59+
* This file has been generated automatically from *
60+
* *
61+
* src/core/qgsfeaturepickermodel.h *
62+
* *
63+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
64+
************************************************************************/

0 commit comments

Comments
 (0)