Skip to content

Commit a15c183

Browse files
committedOct 26, 2017
More doxymentation
1 parent d8b641b commit a15c183

File tree

2 files changed

+176
-15
lines changed

2 files changed

+176
-15
lines changed
 

‎python/gui/qgsfeaturelistcombobox.sip

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,12 @@
1212
class QgsFeatureListComboBox : QComboBox
1313
{
1414
%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
3021
%End
3122

3223
%TypeHeaderCode
@@ -37,47 +28,92 @@ email : matthias@opengis.ch
3728

3829
QgsVectorLayer *sourceLayer() const;
3930
%Docstring
31+
The layer from which features should be listed.
4032
:rtype: QgsVectorLayer
4133
%End
34+
4235
void setSourceLayer( QgsVectorLayer *sourceLayer );
36+
%Docstring
37+
The layer from which features should be listed.
38+
%End
4339

4440
QString displayExpression() const;
4541
%Docstring
42+
The display expression will be used to display features as well as
43+
the the value to match the typed text against.
4644
:rtype: str
4745
%End
46+
4847
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
4952

5053
QString filterExpression() const;
5154
%Docstring
55+
An additional expression to further restrict the available features.
56+
This can be used to integrate additional spatial or other constraints.
5257
:rtype: str
5358
%End
59+
5460
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
5567

5668
QVariant identifierValue() const;
5769
%Docstring
70+
The identifier value of the currently selected feature. A value from the
71+
identifierField.
5872
:rtype: QVariant
5973
%End
74+
6075
void setIdentifierValue( const QVariant &identifierValue );
76+
%Docstring
77+
The identifier value of the currently selected feature. A value from the
78+
identifierField.
79+
%End
6180

6281
QgsFeatureRequest currentFeatureRequest() const;
6382
%Docstring
83+
Shorthand for getting a feature request to query the currently selected
84+
feature.
6485
:rtype: QgsFeatureRequest
6586
%End
6687

6788
bool allowNull() const;
6889
%Docstring
90+
Determines if a NULL value should be available in the list.
91+
92+
TODO!
6993
:rtype: bool
7094
%End
95+
7196
void setAllowNull( bool allowNull );
97+
%Docstring
98+
Determines if a NULL value should be available in the list.
99+
%End
72100

73101
QString identifierField() const;
74102
%Docstring
103+
Field name that will be used to uniquely identify the current feature.
104+
Normally the primary key of the layer.
75105
:rtype: str
76106
%End
107+
77108
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
78113

79114
QModelIndex currentModelIndex() const;
80115
%Docstring
116+
The index of the currently selected item.
81117
:rtype: QModelIndex
82118
%End
83119

@@ -86,12 +122,40 @@ email : matthias@opengis.ch
86122
virtual void keyPressEvent( QKeyEvent *event );
87123

88124
signals:
125+
89126
void sourceLayerChanged();
127+
%Docstring
128+
The layer from which features should be listed.
129+
%End
130+
90131
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+
91137
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+
92143
void identifierValueChanged();
144+
%Docstring
145+
The identifier value of the currently selected feature. A value from the
146+
identifierField.
147+
%End
148+
93149
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+
94155
void allowNullChanged();
156+
%Docstring
157+
Determines if a NULL value should be available in the list.
158+
%End
95159

96160
};
97161

‎src/gui/qgsfeaturelistcombobox.h

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ class QgsFeatureFilterModel;
2727
class QgsAnimatedIcon;
2828
class QgsFilterLineEdit;
2929

30+
/**
31+
* This offers a combobox with autocompleter that allows to select features from a layer.
32+
*
33+
* It will show up to 100 entries at a time. The entries can be chosen based on the displayExpression
34+
* and whenever text is typed into the combobox, the completer and popup will adjust to features matching the typed text.
35+
*
36+
* \since QGIS 3.0
37+
*/
3038
class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
3139
{
3240
Q_OBJECT
@@ -41,38 +49,127 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
4149
public:
4250
QgsFeatureListComboBox( QWidget *parent = nullptr );
4351

52+
/**
53+
* The layer from which features should be listed.
54+
*/
4455
QgsVectorLayer *sourceLayer() const;
56+
57+
/**
58+
* The layer from which features should be listed.
59+
*/
4560
void setSourceLayer( QgsVectorLayer *sourceLayer );
4661

62+
/**
63+
* The display expression will be used to display features as well as
64+
* the the value to match the typed text against.
65+
*/
4766
QString displayExpression() const;
67+
68+
/**
69+
* The display expression will be used to display features as well as
70+
* the the value to match the typed text against.
71+
*/
4872
void setDisplayExpression( const QString &displayExpression );
4973

74+
/**
75+
* An additional expression to further restrict the available features.
76+
* This can be used to integrate additional spatial or other constraints.
77+
*/
5078
QString filterExpression() const;
79+
80+
/**
81+
* An additional expression to further restrict the available features.
82+
* This can be used to integrate additional spatial or other constraints.
83+
*
84+
* TODO!
85+
*/
5186
void setFilterExpression( const QString &filterExpression );
5287

88+
/**
89+
* The identifier value of the currently selected feature. A value from the
90+
* identifierField.
91+
*/
5392
QVariant identifierValue() const;
93+
94+
/**
95+
* The identifier value of the currently selected feature. A value from the
96+
* identifierField.
97+
*/
5498
void setIdentifierValue( const QVariant &identifierValue );
5599

100+
/**
101+
* Shorthand for getting a feature request to query the currently selected
102+
* feature.
103+
*/
56104
QgsFeatureRequest currentFeatureRequest() const;
57105

106+
/**
107+
* Determines if a NULL value should be available in the list.
108+
*
109+
* TODO!
110+
*/
58111
bool allowNull() const;
112+
113+
/**
114+
* Determines if a NULL value should be available in the list.
115+
*/
59116
void setAllowNull( bool allowNull );
60117

118+
/**
119+
* Field name that will be used to uniquely identify the current feature.
120+
* Normally the primary key of the layer.
121+
*/
61122
QString identifierField() const;
123+
124+
/**
125+
* Field name that will be used to uniquely identify the current feature.
126+
* Normally the primary key of the layer.
127+
*/
62128
void setIdentifierField( const QString &identifierField );
63129

130+
/**
131+
* The index of the currently selected item.
132+
*/
64133
QModelIndex currentModelIndex() const;
65134

66135
virtual void focusOutEvent( QFocusEvent *event ) override;
67136

68137
virtual void keyPressEvent( QKeyEvent *event ) override;
69138

70139
signals:
140+
141+
/**
142+
* The layer from which features should be listed.
143+
*/
71144
void sourceLayerChanged();
145+
146+
/**
147+
* The display expression will be used to display features as well as
148+
* the the value to match the typed text against.
149+
*/
72150
void displayExpressionChanged();
151+
152+
/**
153+
* An additional expression to further restrict the available features.
154+
* This can be used to integrate additional spatial or other constraints.
155+
*/
73156
void filterExpressionChanged();
157+
158+
/**
159+
* The identifier value of the currently selected feature. A value from the
160+
* identifierField.
161+
*/
74162
void identifierValueChanged();
163+
164+
/**
165+
* Field name that will be used to uniquely identify the current feature.
166+
* Normally the primary key of the layer.
167+
*/
75168
void identifierFieldChanged();
169+
170+
/**
171+
* Determines if a NULL value should be available in the list.
172+
*/
76173
void allowNullChanged();
77174

78175
private slots:

0 commit comments

Comments
 (0)
Please sign in to comment.