Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[FEATURE] Add QgsFeatureListComboBox with live-filter-capabilities
- Loading branch information
Showing
with
1,281 additions
and 0 deletions.
- +1 −0 python/core/core_auto.sip
- +118 −0 python/core/qgsfeaturefiltermodel.sip
- +1 −0 python/gui/gui_auto.sip
- +104 −0 python/gui/qgsfeaturelistcombobox.sip
- +3 −0 src/core/CMakeLists.txt
- +412 −0 src/core/qgsfeaturefiltermodel.cpp
- +163 −0 src/core/qgsfeaturefiltermodel.h
- +131 −0 src/core/qgsfeaturefiltermodel_p.h
- +2 −0 src/gui/CMakeLists.txt
- +217 −0 src/gui/qgsfeaturelistcombobox.cpp
- +110 −0 src/gui/qgsfeaturelistcombobox.h
- +19 −0 src/gui/qgsfeaturelistcombobox_p.h
@@ -0,0 +1,118 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsfeaturefiltermodel.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsFeatureFilterModel : QAbstractItemModel | ||
{ | ||
%Docstring | ||
Provides a list of features based on filter conditions. | ||
Features are fetched asynchronously. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsfeaturefiltermodel.h" | ||
%End | ||
public: | ||
enum Role | ||
{ | ||
IdentifierValueRole, | ||
ValueRole | ||
}; | ||
|
||
QgsFeatureFilterModel( QObject *parent = 0 ); | ||
~QgsFeatureFilterModel(); | ||
|
||
QgsVectorLayer *sourceLayer() const; | ||
%Docstring | ||
:rtype: QgsVectorLayer | ||
%End | ||
void setSourceLayer( QgsVectorLayer *sourceLayer ); | ||
|
||
QString displayExpression() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setDisplayExpression( const QString &displayExpression ); | ||
|
||
QString filterValue() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setFilterValue( const QString &filterValue ); | ||
|
||
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. | ||
:rtype: str | ||
%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 | ||
:rtype: bool | ||
%End | ||
|
||
QString identifierField() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setIdentifierField( const QString &identifierField ); | ||
|
||
QVariant extraIdentifierValue() const; | ||
%Docstring | ||
:rtype: QVariant | ||
%End | ||
void setExtraIdentifierValue( const QVariant &extraIdentifierValue ); | ||
|
||
int extraIdentifierValueIndex() const; | ||
%Docstring | ||
:rtype: int | ||
%End | ||
|
||
bool extraValueDoesNotExist() const; | ||
%Docstring | ||
:rtype: bool | ||
%End | ||
|
||
signals: | ||
void sourceLayerChanged(); | ||
void displayExpressionChanged(); | ||
void filterValueChanged(); | ||
void filterExpressionChanged(); | ||
void isLoadingChanged(); | ||
void identifierFieldChanged(); | ||
void filterJobCompleted(); | ||
void extraIdentifierValueChanged(); | ||
void extraIdentifierValueIndexChanged( int index ); | ||
void extraValueDoesNotExistChanged(); | ||
void beginUpdate(); | ||
void endUpdate(); | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsfeaturefiltermodel.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
@@ -0,0 +1,104 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsfeaturelistcombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsFeatureListComboBox : QComboBox | ||
{ | ||
%Docstring | ||
************************************************************************* | ||
qgsfieldlistcombobox.h - QgsFieldListComboBox | ||
|
||
--------------------- | ||
begin : 10.3.2017 | ||
copyright : (C) 2017 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
************************************************************************** | ||
* | ||
This program is free software; you can redistribute it and/or modify * | ||
it under the terms of the GNU General Public License as published by * | ||
the Free Software Foundation; either version 2 of the License, or * | ||
(at your option) any later version. * | ||
* | ||
************************************************************************** | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsfeaturelistcombobox.h" | ||
%End | ||
public: | ||
QgsFeatureListComboBox( QWidget *parent = 0 ); | ||
|
||
QgsVectorLayer *sourceLayer() const; | ||
%Docstring | ||
:rtype: QgsVectorLayer | ||
%End | ||
void setSourceLayer( QgsVectorLayer *sourceLayer ); | ||
|
||
QString displayExpression() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setDisplayExpression( const QString &displayExpression ); | ||
|
||
QString filterExpression() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setFilterExpression( const QString &filterExpression ); | ||
|
||
QVariant identifierValue() const; | ||
%Docstring | ||
:rtype: QVariant | ||
%End | ||
void setIdentifierValue( const QVariant &identifierValue ); | ||
|
||
QgsFeatureRequest currentFeatureRequest() const; | ||
%Docstring | ||
:rtype: QgsFeatureRequest | ||
%End | ||
|
||
bool allowNull() const; | ||
%Docstring | ||
:rtype: bool | ||
%End | ||
void setAllowNull( bool allowNull ); | ||
|
||
QString identifierField() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
void setIdentifierField( const QString &identifierField ); | ||
|
||
QModelIndex currentModelIndex() const; | ||
%Docstring | ||
:rtype: QModelIndex | ||
%End | ||
|
||
virtual void focusOutEvent( QFocusEvent *event ); | ||
|
||
virtual void keyPressEvent( QKeyEvent *event ); | ||
|
||
signals: | ||
void sourceLayerChanged(); | ||
void displayExpressionChanged(); | ||
void filterExpressionChanged(); | ||
void identifierValueChanged(); | ||
void identifierFieldChanged(); | ||
void allowNullChanged(); | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsfeaturelistcombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
Oops, something went wrong.