QGIS/python/gui/auto_generated/attributetable/qgsfeaturelistmodel.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

207 lines
5.7 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFeatureListModel : QSortFilterProxyModel, QgsFeatureModel
{
%Docstring(signature="appended")
A proxy model for feature lists.
%End
%TypeHeaderCode
#include "qgsfeaturelistmodel.h"
%End
public:
struct FeatureInfo
{
public:
FeatureInfo();
bool isNew;
bool isEdited;
};
enum Role
{
FeatureInfoRole,
FeatureRole,
FeatureWithGeometryRole,
};
public:
explicit QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsFeatureListModel
%End
virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );
QgsVectorLayerCache *layerCache();
%Docstring
Returns the vector layer cache which is being used to populate the
model.
%End
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
void setInjectNull( bool injectNull );
%Docstring
If ``True`` is specified, a NULL value will be injected
:param injectNull: state of null value injection
.. note::
If set to ``True``, the sort by display expression cannot be used
%End
bool injectNull();
%Docstring
Returns the current state of null value injection
:return: If a NULL value is added
%End
QgsAttributeTableModel *masterModel();
bool setDisplayExpression( const QString &expression );
%Docstring
:param expression: A :py:class:`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 :py:func:`~QgsFeatureListModel.parserErrorString`
for a meaningful error message.
%End
QString parserErrorString();
%Docstring
Returns a detailed message about errors while parsing a
:py:class:`QgsExpression`.
:return: A message containing information about the parser error.
%End
QString displayExpression() const;
bool featureByIndex( const QModelIndex &index, QgsFeature &feat );
QgsFeatureId idxToFid( const QModelIndex &index ) const;
%Docstring
Returns the feature ID corresponding to an ``index`` from the model.
.. seealso:: :py:func:`fidToIdx`
%End
QModelIndex fidToIdx( QgsFeatureId fid ) const;
%Docstring
Returns the model index corresponding to a feature ID.
.. seealso:: :py:func:`idxToFid`
%End
virtual QModelIndex mapToSource( const QModelIndex &proxyIndex ) const;
virtual QModelIndex mapFromSource( const QModelIndex &sourceIndex ) const;
virtual QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;
virtual QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;
virtual QItemSelection mapSelectionFromMaster( const QItemSelection &selection ) const;
virtual QItemSelection mapSelectionToMaster( const QItemSelection &selection ) const;
virtual QModelIndex parent( const QModelIndex &child ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndexList fidToIndexList( QgsFeatureId fid );
bool sortByDisplayExpression() const;
%Docstring
Sort this model by its display expression.
.. versionadded:: 3.2
%End
void setSortByDisplayExpression( bool sortByDisplayExpression, Qt::SortOrder order = Qt::AscendingOrder );
%Docstring
Sort this model by its display expression.
.. note::
Not compatible with injectNull, if sorting by display expression is enabled,
injectNull will automatically turned off.
.. versionadded:: 3.2
%End
public slots:
void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling
:py:func:`~QgsFeatureListModel.beginRemoveRows`
.. deprecated:: 3.40
Use :py:func:`~QgsFeatureListModel.beginRemoveRows` instead.
%End
void onEndRemoveRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling
:py:func:`~QgsFeatureListModel.endRemoveRows`
.. deprecated:: 3.40
Use :py:func:`~QgsFeatureListModel.endRemoveRows` instead.
%End
void onBeginInsertRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling
:py:func:`~QgsFeatureListModel.beginInsertRows`
.. deprecated:: 3.40
Use :py:func:`~QgsFeatureListModel.beginInsertRows` instead.
%End
void onEndInsertRows( const QModelIndex &parent, int first, int last );
%Docstring
Does nothing except for calling
:py:func:`~QgsFeatureListModel.endInsertRows`
.. deprecated:: 3.40
Use :py:func:`~QgsFeatureListModel.endInsertRows` instead.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/