Skip to content

Commit c22c73d

Browse files
authoredMay 5, 2020
allow fetching all features in QgsFeaturePickerWidget (#36193)
and more documentation
1 parent 9e91eb5 commit c22c73d

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed
 

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Returns the feature request fetch limit
148148
void setFetchLimit( int fetchLimit );
149149
%Docstring
150150
Defines the feature request fetch limit
151+
If set to 0, no limit is applied when fetching
151152
%End
152153

153154
signals:

‎python/gui/auto_generated/qgsfeaturepickerwidget.sip.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Returns the feature request fetch limit
110110
void setFetchLimit( int fetchLimit );
111111
%Docstring
112112
Defines the feature request fetch limit
113+
If set to 0, no limit is applied when fetching
113114
%End
114115

115116
bool showBrowserButtons() const;
@@ -120,6 +121,10 @@ Returns if the browsing buttons are shown
120121
void setShowBrowserButtons( bool showBrowserButtons );
121122
%Docstring
122123
Defines if the browsing buttons are shown
124+
125+
.. note::
126+
127+
Buttons are browsing the currently fetched features. If a limit is set, there might be more features to be fetched from the layer.
123128
%End
124129

125130

‎src/core/qgsfeaturepickermodelbase.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ void QgsFeaturePickerModelBase::scheduledReload()
409409

410410
if ( !mFetchGeometry )
411411
request.setFlags( QgsFeatureRequest::NoGeometry );
412-
request.setLimit( mFetchLimit );
412+
if ( mFetchLimit > 0 )
413+
request.setLimit( mFetchLimit );
413414

414415
mGatherer = createValuesGatherer( request );
415416
mGatherer->setData( mShouldReloadCurrentFeature );

‎src/core/qgsfeaturepickermodelbase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ class CORE_EXPORT QgsFeaturePickerModelBase : public QAbstractItemModel SIP_ABST
170170

171171
/**
172172
* Defines the feature request fetch limit
173+
* If set to 0, no limit is applied when fetching
173174
*/
174175
void setFetchLimit( int fetchLimit );
175176

‎src/gui/qgsfeaturepickerwidget.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class GUI_EXPORT QgsFeaturePickerWidget : public QWidget
137137

138138
/**
139139
* Defines the feature request fetch limit
140+
* If set to 0, no limit is applied when fetching
140141
*/
141142
void setFetchLimit( int fetchLimit );
142143

@@ -147,6 +148,7 @@ class GUI_EXPORT QgsFeaturePickerWidget : public QWidget
147148

148149
/**
149150
* Defines if the browsing buttons are shown
151+
* \note Buttons are browsing the currently fetched features. If a limit is set, there might be more features to be fetched from the layer.
150152
*/
151153
void setShowBrowserButtons( bool showBrowserButtons );
152154

0 commit comments

Comments
 (0)
Please sign in to comment.