Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 29, 2020
1 parent 1065039 commit 3cd237e
Show file tree
Hide file tree
Showing 20 changed files with 1,664 additions and 85 deletions.
199 changes: 199 additions & 0 deletions python/core/auto_generated/qgsfeaturechoosermodel.sip.in
@@ -0,0 +1,199 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeaturechoosermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsFeatureChooserModel : QAbstractItemModel
{
%Docstring
Provides a list of features based on filter conditions.
Features are fetched asynchronously.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsfeaturechoosermodel.h"
%End
public:

enum Role
{
ValueRole,
FeatureRole,
FeatureIdRole
};

explicit QgsFeatureChooserModel( QObject *parent = 0 );
%Docstring
Create a new QgsFeatureChooserModel, optionally specifying a ``parent``.
%End
~QgsFeatureChooserModel();

QgsVectorLayer *sourceLayer() const;
%Docstring
The source layer from which features will be fetched.
%End

void setSourceLayer( QgsVectorLayer *sourceLayer );
%Docstring
The source layer from which features will be fetched.
%End

QString displayExpression() const;
%Docstring
The display expression will be used for

- displaying values in the combobox
- filtering based on filterValue
%End

void setDisplayExpression( const QString &displayExpression );
%Docstring
The display expression will be used for

- displaying values in the combobox
- filtering based on filterValue
%End

QString filterValue() const;
%Docstring
This value will be used to filter the features available from
this model. Whenever a substring of the displayExpression of a feature
matches the filter value, it will be accessible by this model.
%End

void setFilterValue( const QString &filterValue );
%Docstring
This value will be used to filter the features available from
this model. Whenever a substring of the displayExpression of a feature
matches the filter value, it will be accessible by this model.
%End

virtual QModelIndex index( int row, int column, const QModelIndex &parent ) const;

virtual QModelIndex parent( const QModelIndex &child ) const;

virtual int rowCount( const QModelIndex &parent ) const;

virtual int columnCount( const QModelIndex &parent ) const;

virtual QVariant data( const QModelIndex &index, int role ) const;


QString filterExpression() const;
%Docstring
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
%End

void setFilterExpression( const QString &filterExpression );
%Docstring
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
%End

bool isLoading() const;
%Docstring
Indicator if the model is currently performing any feature iteration in the background.
%End

bool allowNull() const;
%Docstring
Add a NULL entry to the list.
%End

void setAllowNull( bool allowNull );
%Docstring
Add a NULL entry to the list.
%End

QgsFeature currentFeature() const;

void setCurrentFeature( const QgsFeatureId &featureId );
%Docstring
Sets the current feature id
%End

int currentIndex() const;
%Docstring
Returns the current index
%End

signals:

void currentIndexChanged( int index );
%Docstring
Emitted when the current index changed
%End

void currentFeatureChanged( const QgsFeature &feature );
%Docstring
Emitted when the current feature changed
%End

void sourceLayerChanged();
%Docstring
The source layer from which features will be fetched.
%End

void displayExpressionChanged();
%Docstring
The display expression will be used for

- displaying values in the combobox
- filtering based on filterValue
%End

void filterValueChanged();
%Docstring
This value will be used to filter the features available from
this model. Whenever a substring of the displayExpression of a feature
matches the filter value, it will be accessible by this model.
%End

void filterExpressionChanged();
%Docstring
An additional filter expression to apply, next to the filterValue.
Can be used for spatial filtering etc.
%End

void isLoadingChanged();
%Docstring
Indicator if the model is currently performing any feature iteration in the background.
%End

void filterJobCompleted();
%Docstring
Indicates that a filter job has been completed and new data may be available.
%End

void beginUpdate();
%Docstring
Notification that the model is about to be changed because a job was completed.
%End

void endUpdate();
%Docstring
Notification that the model change is finished. Will always be emitted in sync with beginUpdate.
%End

void allowNullChanged();
%Docstring
Add a NULL entry to the list.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeaturechoosermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 0 additions & 1 deletion python/core/auto_generated/qgsfeaturefiltermodel.sip.in
Expand Up @@ -8,7 +8,6 @@




class QgsFeatureFilterModel : QAbstractItemModel
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Expand Up @@ -61,6 +61,7 @@
%Include auto_generated/qgsexpressioncontextscopegenerator.sip
%Include auto_generated/qgsexpressionfieldbuffer.sip
%Include auto_generated/qgsfeature.sip
%Include auto_generated/qgsfeaturechoosermodel.sip
%Include auto_generated/qgsfeaturefiltermodel.sip
%Include auto_generated/qgsfeaturefilterprovider.sip
%Include auto_generated/qgsfeatureid.sip
Expand Down
7 changes: 5 additions & 2 deletions python/gui/auto_generated/qgsexpressionpreviewwidget.sip.in
Expand Up @@ -54,8 +54,6 @@ Sets the expression context for the widget. The context is used for the expressi
preview result and to populate the list of available functions and variables.

:param context: expression context

.. versionadded:: 2.12
%End

void setGeomCalculator( const QgsDistanceArea &da );
Expand Down Expand Up @@ -114,6 +112,11 @@ Emitted whenever the tool tip changed
%End

public slots:
void setCurrentFeature( const QgsFeature &feature );
%Docstring
sets the current feature used
%End


};

Expand Down
150 changes: 150 additions & 0 deletions python/gui/auto_generated/qgsfeaturechooserwidget.sip.in
@@ -0,0 +1,150 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfeaturechooserwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsFeatureChooserWidget : QWidget
{
%Docstring
This offers a combobox with autocompleter that allows selecting features from a layer.

It will show up to 100 entries at a time. The entries can be chosen based on the displayExpression
and whenever text is typed into the combobox, the completer and popup will adjust to features matching the typed text.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsfeaturechooserwidget.h"
%End
public:

QgsFeatureChooserWidget( QWidget *parent = 0 );
%Docstring
Create a new QgsFeatureChooserWidget, optionally specifying a ``parent``.
%End

QgsVectorLayer *layer() const;
%Docstring
The layer from which features should be listed.
%End

void setLayer( QgsVectorLayer *layer );
%Docstring
The layer from which features should be listed.
%End

void setCurrentFeature( const QgsFeature &feature );
%Docstring
Sets the current index by using the given feature
%End

QString displayExpression() const;
%Docstring
The display expression will be used to display features as well as
the value to match the typed text against.
%End

void setDisplayExpression( const QString &displayExpression );
%Docstring
The display expression will be used to display features as well as
the value to match the typed text against.
%End

QString filterExpression() const;
%Docstring
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
%End

int nullIndex() const;
%Docstring
Returns the current index of the NULL value, or -1 if NULL values are
not allowed.

.. versionadded:: 3.2
%End

void setFilterExpression( const QString &filterExpression );
%Docstring
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.

TODO!
%End

bool allowNull() const;
%Docstring
Determines if a NULL value should be available in the list.
%End

void setAllowNull( bool allowNull );
%Docstring
Determines if a NULL value should be available in the list.
%End

QModelIndex currentModelIndex() const;
%Docstring
The index of the currently selected item.
%End

virtual void focusOutEvent( QFocusEvent *event );


virtual void keyPressEvent( QKeyEvent *event );


signals:

void modelUpdated();
%Docstring
The underlying model has been updated.

.. versionadded:: 3.2
%End

void layerChanged();
%Docstring
The layer from which features should be listed.
%End

void displayExpressionChanged();
%Docstring
The display expression will be used to display features as well as
the the value to match the typed text against.
%End

void filterExpressionChanged();
%Docstring
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
%End

void allowNullChanged();
%Docstring
Determines if a NULL value should be available in the list.
%End

void currentFeatureChanged( const QgsFeature &feature );
%Docstring
Sends the feature as soon as it is chosen
%End

};



/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfeaturechooserwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -80,6 +80,7 @@
%Include auto_generated/qgsextentgroupbox.sip
%Include auto_generated/qgsextentwidget.sip
%Include auto_generated/qgsexternalresourcewidget.sip
%Include auto_generated/qgsfeaturechooserwidget.sip
%Include auto_generated/qgsfeaturelistcombobox.sip
%Include auto_generated/qgsfeatureselectiondlg.sip
%Include auto_generated/qgsfieldcombobox.sip
Expand Down

0 comments on commit 3cd237e

Please sign in to comment.