Skip to content
Permalink
Browse files

do not use template since they cannot be mixed with Q_OBJECT

  • Loading branch information
3nids committed Apr 29, 2020
1 parent 780b581 commit ae5988cbb168db1edee3e4dad98d68d92dcc1033
@@ -8,10 +8,7 @@




typedef QgsFeaturePickerModelBase<QgsFeatureByIdentifierFieldsExpressionValuesGatherer> QgsFeaturePickerModelBaseQgsFeatureByIdentifierFieldsExpressionValuesGathererBase;

class QgsFeatureFilterModel : QgsFeaturePickerModelBaseQgsFeatureByIdentifierFieldsExpressionValuesGathererBase
class QgsFeatureFilterModel : QgsFeaturePickerModelBase
{
%Docstring
Provides a list of features based on filter conditions.
@@ -22,18 +19,9 @@ Features are fetched asynchronously.

%TypeHeaderCode
#include "qgsfeaturefiltermodel.h"
#include "qgsfeaturepickermodelbase.h"
typedef QgsFeaturePickerModelBase<QgsFeatureByIdentifierFieldsExpressionValuesGatherer> QgsFeaturePickerModelBaseQgsFeatureByIdentifierFieldsExpressionValuesGathererBase;
%End
public:

enum Role
{
IdentifierValueRole,
IdentifierValuesRole,
ValueRole
};

explicit QgsFeatureFilterModel( QObject *parent = 0 );
%Docstring
Create a new QgsFeatureFilterModel, optionally specifying a ``parent``.
@@ -78,8 +66,21 @@ still be available in the model as NULL value(s).
.. versionadded:: 3.10
%End

virtual QVariantList extraIdentifierValue() const;
QVariantList extraIdentifierValues() const;
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.

.. versionadded:: 3.10
%End

void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.

.. versionadded:: 3.10
%End


signals:
@@ -90,10 +91,11 @@ The identifier field should be a unique field that can be used to identify indiv
It is normally set to the primary key of the layer.
%End

protected:
virtual QgsFeatureByIdentifierFieldsExpressionValuesGatherer createValuesGatherer( const QgsFeatureRequest &request ) const;


void extraIdentifierValuesChanged();
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.
%End

};

@@ -8,10 +8,7 @@




typedef QgsFeaturePickerModelBase<QgsFeatureByIdExpressionValuesGatherer> QgsFeaturePickerModelBaseQgsFeatureByIdExpressionValuesGathererBase;

class QgsFeaturePickerModel : QgsFeaturePickerModelBaseQgsFeatureByIdExpressionValuesGathererBase
class QgsFeaturePickerModel : QgsFeaturePickerModelBase
{
%Docstring
Provides a list of features based on filter conditions.
@@ -22,16 +19,13 @@ Features are fetched asynchronously.

%TypeHeaderCode
#include "qgsfeaturepickermodel.h"
#include "qgsfeaturepickermodelbase.h"
typedef QgsFeaturePickerModelBase<QgsFeatureByIdExpressionValuesGatherer> QgsFeaturePickerModelBaseQgsFeatureByIdExpressionValuesGathererBase;
%End
public:

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

virtual void setExtraIdentifierValueToNull();

@@ -42,6 +36,14 @@ still be available in the model as NULL value(s).
.. versionadded:: 3.10
%End

void setFeature( const QgsFeatureId &fid );
%Docstring
Set the feature to the given feature id
%End

signals:
void featureChanged( const QgsFeature &feature );


};

@@ -0,0 +1,236 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeaturepickermodelbase.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



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

.. versionadded:: 3.0
%End

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

enum Role
{
IdentifierValueRole,
IdentifierValuesRole,
ValueRole,
FeatureRole,
FeatureIdRole
};

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

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

virtual void setExtraIdentifierValueToNull() = 0;
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model as NULL value(s).

.. versionadded:: 3.10
%End

int extraIdentifierValueIndex() const;
%Docstring
The index at which the extra identifier value is available within the model.
%End

bool extraValueDoesNotExist() const;
%Docstring
Flag indicating that the extraIdentifierValue does not exist in the data.
%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

signals:

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 extraIdentifierValueChanged();
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.
%End

void extraIdentifierValueIndexChanged( int index );
%Docstring
The index at which the extra identifier value is available within the model.
%End

void extraValueDoesNotExistChanged();
%Docstring
Flag indicating that the extraIdentifierValue does not exist in the data.
%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

protected:

QVariant extraIdentifierValue() const;
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.
%End

void setExtraIdentifierValue( const QVariant &extraIdentifierValue );
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model.
%End

virtual void requestToReloadCurrentFeature( QgsFeatureRequest &request ) = 0;
%Docstring
Update the request to match the current feature to be reloaded
%End

void setExtraIdentifierValueUnguarded( const QVariant &identifierValue );




};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeaturepickermodelbase.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -62,6 +62,7 @@
%Include auto_generated/qgsexpressionfieldbuffer.sip
%Include auto_generated/qgsfeature.sip
%Include auto_generated/qgsfeaturepickermodel.sip
%Include auto_generated/qgsfeaturepickermodelbase.sip
%Include auto_generated/qgsfeaturefiltermodel.sip
%Include auto_generated/qgsfeaturefilterprovider.sip
%Include auto_generated/qgsfeatureid.sip
@@ -41,7 +41,7 @@ The layer from which features should be listed.
The layer from which features should be listed.
%End

void setCurrentFeature( QgsFeatureId featureId );
void setFeature( QgsFeatureId featureId );
%Docstring
Sets the current index by using the given feature
%End
@@ -132,7 +132,7 @@ This can be used to integrate additional spatial or other constraints.
Determines if a NULL value should be available in the list.
%End

void currentFeatureChanged( const QgsFeature &feature );
void featureChanged( const QgsFeature &feature );
%Docstring
Sends the feature as soon as it is chosen
%End
@@ -34,7 +34,7 @@ fi
if [[ -n $1 ]]; then
modules=("$1")
else
modules=(core gui analysis server 3d)
modules=(core gui analysis server)
fi
sources=(HDRS MOC_HDRS SRCS)

0 comments on commit ae5988c

Please sign in to comment.
You can’t perform that action at this time.