1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
/************************************************************************
* 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
{
%TypeHeaderCode
#include "qgsfeaturelistmodel.h"
%End
public:
struct FeatureInfo
{
public:
FeatureInfo();
bool isNew;
bool isEdited;
};
enum Role /BaseType=IntEnum/
{
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 *
************************************************************************/
|