2017-06-08 15:51:05 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/attributetable/qgsfeaturelistmodel.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-15 11:58:10 +02:00
|
|
|
class QgsFeatureListModel : QSortFilterProxyModel, QgsFeatureModel
|
2013-06-22 19:37:41 +02:00
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-08 15:51:05 +02:00
|
|
|
#include "qgsfeaturelistmodel.h"
|
2013-06-22 19:37:41 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
struct FeatureInfo
|
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
public:
|
2017-09-28 08:17:06 +10:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
FeatureInfo();
|
2017-09-28 08:17:06 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for FeatureInfo.
|
2017-09-28 08:17:06 +10:00
|
|
|
%End
|
2017-06-08 15:51:05 +02:00
|
|
|
|
|
|
|
bool isNew;
|
|
|
|
bool isEdited;
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
enum Role
|
|
|
|
{
|
|
|
|
FeatureInfoRole,
|
|
|
|
FeatureRole
|
|
|
|
};
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
public:
|
2017-12-12 11:44:10 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
explicit QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent /TransferThis/ = 0 );
|
2017-12-12 11:44:10 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsFeatureListModel
|
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );
|
|
|
|
QgsVectorLayerCache *layerCache();
|
|
|
|
virtual QVariant data( const QModelIndex &index, int role ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2015-12-01 11:45:30 +01:00
|
|
|
void setInjectNull( bool injectNull );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
|
|
|
If true is specified, a NULL value will be injected
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param injectNull: state of null value injection
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.9
|
|
|
|
%End
|
2015-12-01 11:45:30 +01:00
|
|
|
|
|
|
|
bool injectNull();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the current state of null value injection
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: If a NULL value is added
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.9
|
|
|
|
%End
|
2015-12-01 11:45:30 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsAttributeTableModel *masterModel();
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
bool setDisplayExpression( const QString &expression );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
\param expression A QgsExpression compatible string.
|
|
|
|
|
|
|
|
:return: true if the expression could be set, false if there was a parse error.
|
|
|
|
If it fails, the old expression will still be applied. Call parserErrorString()
|
|
|
|
for a meaningful error message.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
QString parserErrorString();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-19 11:43:52 -04:00
|
|
|
Returns a detailed message about errors while parsing a :py:class:`QgsExpression`.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: A message containing information about the parser error.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
QString displayExpression() const;
|
2017-05-01 18:13:15 +02:00
|
|
|
bool featureByIndex( const QModelIndex &index, QgsFeature &feat );
|
|
|
|
QgsFeatureId idxToFid( const QModelIndex &index ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
QModelIndex fidToIdx( const QgsFeatureId fid ) const;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QModelIndex mapToSource( const QModelIndex &proxyIndex ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QModelIndex mapFromSource( const QModelIndex &sourceIndex ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;
|
|
|
|
virtual QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QItemSelection mapSelectionFromMaster( const QItemSelection &selection ) const;
|
|
|
|
virtual QItemSelection mapSelectionToMaster( const QItemSelection &selection ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QModelIndex parent( const QModelIndex &child ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
virtual QModelIndex fidToIndex( QgsFeatureId fid );
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
QModelIndexList fidToIndexList( QgsFeatureId fid );
|
|
|
|
|
|
|
|
public slots:
|
2017-05-01 18:13:15 +02:00
|
|
|
void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
|
|
|
|
void onEndRemoveRows( const QModelIndex &parent, int first, int last );
|
|
|
|
void onBeginInsertRows( const QModelIndex &parent, int first, int last );
|
|
|
|
void onEndInsertRows( const QModelIndex &parent, int first, int last );
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|
2017-06-08 15:51:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/attributetable/qgsfeaturelistmodel.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|