12
12
class QgsFeatureListComboBox : QComboBox
13
13
{
14
14
%Docstring
15
- *************************************************************************
16
- qgsfieldlistcombobox.h - QgsFieldListComboBox
17
-
18
- ---------------------
19
- begin : 10.3.2017
20
- copyright : (C) 2017 by Matthias Kuhn
21
- email : matthias@opengis.ch
22
- **************************************************************************
23
- *
24
- This program is free software; you can redistribute it and/or modify *
25
- it under the terms of the GNU General Public License as published by *
26
- the Free Software Foundation; either version 2 of the License, or *
27
- (at your option) any later version. *
28
- *
29
- **************************************************************************
15
+ This offers a combobox with autocompleter that allows to select features from a layer.
16
+
17
+ It will show up to 100 entries at a time. The entries can be chosen based on the displayExpression
18
+ and whenever text is typed into the combobox, the completer and popup will adjust to features matching the typed text.
19
+
20
+ .. versionadded:: 3.0
30
21
%End
31
22
32
23
%TypeHeaderCode
@@ -37,47 +28,92 @@ email : matthias@opengis.ch
37
28
38
29
QgsVectorLayer *sourceLayer() const;
39
30
%Docstring
31
+ The layer from which features should be listed.
40
32
:rtype: QgsVectorLayer
41
33
%End
34
+
42
35
void setSourceLayer( QgsVectorLayer *sourceLayer );
36
+ %Docstring
37
+ The layer from which features should be listed.
38
+ %End
43
39
44
40
QString displayExpression() const;
45
41
%Docstring
42
+ The display expression will be used to display features as well as
43
+ the the value to match the typed text against.
46
44
:rtype: str
47
45
%End
46
+
48
47
void setDisplayExpression( const QString &displayExpression );
48
+ %Docstring
49
+ The display expression will be used to display features as well as
50
+ the the value to match the typed text against.
51
+ %End
49
52
50
53
QString filterExpression() const;
51
54
%Docstring
55
+ An additional expression to further restrict the available features.
56
+ This can be used to integrate additional spatial or other constraints.
52
57
:rtype: str
53
58
%End
59
+
54
60
void setFilterExpression( const QString &filterExpression );
61
+ %Docstring
62
+ An additional expression to further restrict the available features.
63
+ This can be used to integrate additional spatial or other constraints.
64
+
65
+ TODO!
66
+ %End
55
67
56
68
QVariant identifierValue() const;
57
69
%Docstring
70
+ The identifier value of the currently selected feature. A value from the
71
+ identifierField.
58
72
:rtype: QVariant
59
73
%End
74
+
60
75
void setIdentifierValue( const QVariant &identifierValue );
76
+ %Docstring
77
+ The identifier value of the currently selected feature. A value from the
78
+ identifierField.
79
+ %End
61
80
62
81
QgsFeatureRequest currentFeatureRequest() const;
63
82
%Docstring
83
+ Shorthand for getting a feature request to query the currently selected
84
+ feature.
64
85
:rtype: QgsFeatureRequest
65
86
%End
66
87
67
88
bool allowNull() const;
68
89
%Docstring
90
+ Determines if a NULL value should be available in the list.
91
+
92
+ TODO!
69
93
:rtype: bool
70
94
%End
95
+
71
96
void setAllowNull( bool allowNull );
97
+ %Docstring
98
+ Determines if a NULL value should be available in the list.
99
+ %End
72
100
73
101
QString identifierField() const;
74
102
%Docstring
103
+ Field name that will be used to uniquely identify the current feature.
104
+ Normally the primary key of the layer.
75
105
:rtype: str
76
106
%End
107
+
77
108
void setIdentifierField( const QString &identifierField );
109
+ %Docstring
110
+ Field name that will be used to uniquely identify the current feature.
111
+ Normally the primary key of the layer.
112
+ %End
78
113
79
114
QModelIndex currentModelIndex() const;
80
115
%Docstring
116
+ The index of the currently selected item.
81
117
:rtype: QModelIndex
82
118
%End
83
119
@@ -86,12 +122,40 @@ email : matthias@opengis.ch
86
122
virtual void keyPressEvent( QKeyEvent *event );
87
123
88
124
signals:
125
+
89
126
void sourceLayerChanged();
127
+ %Docstring
128
+ The layer from which features should be listed.
129
+ %End
130
+
90
131
void displayExpressionChanged();
132
+ %Docstring
133
+ The display expression will be used to display features as well as
134
+ the the value to match the typed text against.
135
+ %End
136
+
91
137
void filterExpressionChanged();
138
+ %Docstring
139
+ An additional expression to further restrict the available features.
140
+ This can be used to integrate additional spatial or other constraints.
141
+ %End
142
+
92
143
void identifierValueChanged();
144
+ %Docstring
145
+ The identifier value of the currently selected feature. A value from the
146
+ identifierField.
147
+ %End
148
+
93
149
void identifierFieldChanged();
150
+ %Docstring
151
+ Field name that will be used to uniquely identify the current feature.
152
+ Normally the primary key of the layer.
153
+ %End
154
+
94
155
void allowNullChanged();
156
+ %Docstring
157
+ Determines if a NULL value should be available in the list.
158
+ %End
95
159
96
160
};
97
161
0 commit comments