Skip to content

Commit

Permalink
allow fetching all features in QgsFeaturePickerWidget (#36193)
Browse files Browse the repository at this point in the history
and more documentation
  • Loading branch information
3nids committed May 5, 2020
1 parent 9e91eb5 commit c22c73d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Expand Up @@ -148,6 +148,7 @@ Returns the feature request fetch limit
void setFetchLimit( int fetchLimit );
%Docstring
Defines the feature request fetch limit
If set to 0, no limit is applied when fetching
%End

signals:
Expand Down
5 changes: 5 additions & 0 deletions python/gui/auto_generated/qgsfeaturepickerwidget.sip.in
Expand Up @@ -110,6 +110,7 @@ Returns the feature request fetch limit
void setFetchLimit( int fetchLimit );
%Docstring
Defines the feature request fetch limit
If set to 0, no limit is applied when fetching
%End

bool showBrowserButtons() const;
Expand All @@ -120,6 +121,10 @@ Returns if the browsing buttons are shown
void setShowBrowserButtons( bool showBrowserButtons );
%Docstring
Defines if the browsing buttons are shown

.. note::

Buttons are browsing the currently fetched features. If a limit is set, there might be more features to be fetched from the layer.
%End


Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsfeaturepickermodelbase.cpp
Expand Up @@ -409,7 +409,8 @@ void QgsFeaturePickerModelBase::scheduledReload()

if ( !mFetchGeometry )
request.setFlags( QgsFeatureRequest::NoGeometry );
request.setLimit( mFetchLimit );
if ( mFetchLimit > 0 )
request.setLimit( mFetchLimit );

mGatherer = createValuesGatherer( request );
mGatherer->setData( mShouldReloadCurrentFeature );
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsfeaturepickermodelbase.h
Expand Up @@ -170,6 +170,7 @@ class CORE_EXPORT QgsFeaturePickerModelBase : public QAbstractItemModel SIP_ABST

/**
* Defines the feature request fetch limit
* If set to 0, no limit is applied when fetching
*/
void setFetchLimit( int fetchLimit );

Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsfeaturepickerwidget.h
Expand Up @@ -137,6 +137,7 @@ class GUI_EXPORT QgsFeaturePickerWidget : public QWidget

/**
* Defines the feature request fetch limit
* If set to 0, no limit is applied when fetching
*/
void setFetchLimit( int fetchLimit );

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

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

Expand Down

0 comments on commit c22c73d

Please sign in to comment.