Class: QgsFeatureListModel¶
- class qgis.gui.QgsFeatureListModel(sourceModel: QgsAttributeTableFilterModel, parent: QObject = None)¶
Bases:
PyQt5.QtCore.QSortFilterProxyModel
,QgsFeatureModel
Constructor for QgsFeatureListModel
Methods
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
- param parent:
createIndex
- param index:
decodeData
- rtype:
str
- param index:
Returns the model index corresponding to a feature ID.
- param fid:
- param fid:
- param index:
Returns the feature ID corresponding to an
index
from the model.Returns the current state of null value injection
Returns the vector layer cache which is being used to populate the model.
lessThan
- param sourceIndex:
- param sourceIndex:
- param selection:
- param selection:
- param proxyIndex:
- param proxyIndex:
- rtype:
QgsAttributeTableModel
Does nothing except for calling
beginInsertRows()
Does nothing except for calling
beginRemoveRows()
Does nothing except for calling
endInsertRows()
Does nothing except for calling
endRemoveRows()
- param child:
Returns a detailed message about errors while parsing a
QgsExpression
.- param parent:
- type expression:
str
If
True
is specified, a NULL value will be injectedSort this model by its display expression.
- param sourceModel:
Sort this model by its display expression.
Attributes
- class FeatureInfo¶
Bases:
sip.wrapper
Constructor for FeatureInfo.
QgsFeatureListModel.FeatureInfo(QgsFeatureListModel.FeatureInfo)
- isEdited¶
- isNew¶
- FeatureInfoRole = 4096¶
- FeatureRole = 4097¶
- class Role¶
Bases:
int
- QgsFeatureListModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsFeatureListModel.beginInsertRows(self, QModelIndex, int, int)
- QgsFeatureListModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsFeatureListModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsFeatureListModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsFeatureListModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsFeatureListModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- columnCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters:
parent (QModelIndex = QModelIndex()) –
- Return type:
int
- connectNotify(self, QMetaMethod)¶
- QgsFeatureListModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters:
index (QModelIndex) –
role (int) –
- Return type:
Any
- QgsFeatureListModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
- disconnectNotify(self, QMetaMethod)¶
- displayExpression(self) str ¶
- Return type:
str
- encodeData(self, Iterable[QModelIndex], QDataStream)¶
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- featureByIndex(self, index: QModelIndex, feat: QgsFeature) bool ¶
- Parameters:
index (QModelIndex) –
feat (QgsFeature) –
- Return type:
bool
- fidToIdx(self, fid: int) QModelIndex ¶
Returns the model index corresponding to a feature ID.
See also
- Parameters:
fid (int) –
- Return type:
QModelIndex
- fidToIndex(self, fid: int) QModelIndex ¶
- Parameters:
fid (int) –
- Return type:
QModelIndex
- fidToIndexList(self, fid: int) List[QModelIndex] ¶
- Parameters:
fid (int) –
- Return type:
List[QModelIndex]
- filterAcceptsColumn(self, int, QModelIndex) bool ¶
- filterAcceptsRow(self, int, QModelIndex) bool ¶
- flags(self, index: QModelIndex) Qt.ItemFlags ¶
- Parameters:
index (QModelIndex) –
- Return type:
Qt.ItemFlags
- idxToFid(self, index: QModelIndex) int ¶
Returns the feature ID corresponding to an
index
from the model.See also
- Parameters:
index (QModelIndex) –
- Return type:
int
- injectNull(self) bool ¶
Returns the current state of null value injection
- Return type:
bool
- Returns:
If a NULL value is added
New in version 2.9.
- invalidateFilter(self)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- layerCache(self) QgsVectorLayerCache ¶
Returns the vector layer cache which is being used to populate the model.
- Return type:
- QgsFeatureListModel.lessThan(self, QModelIndex, QModelIndex) -> bool
- mapFromMaster(self, sourceIndex: QModelIndex) QModelIndex ¶
- Parameters:
sourceIndex (QModelIndex) –
- Return type:
QModelIndex
- mapFromSource(self, sourceIndex: QModelIndex) QModelIndex ¶
- Parameters:
sourceIndex (QModelIndex) –
- Return type:
QModelIndex
- mapSelectionFromMaster(self, selection: QItemSelection) QItemSelection ¶
- Parameters:
selection (QItemSelection) –
- Return type:
QItemSelection
- mapSelectionToMaster(self, selection: QItemSelection) QItemSelection ¶
- Parameters:
selection (QItemSelection) –
- Return type:
QItemSelection
- mapToMaster(self, proxyIndex: QModelIndex) QModelIndex ¶
- Parameters:
proxyIndex (QModelIndex) –
- Return type:
QModelIndex
- mapToSource(self, proxyIndex: QModelIndex) QModelIndex ¶
- Parameters:
proxyIndex (QModelIndex) –
- Return type:
QModelIndex
- masterModel(self) QgsAttributeTableModel ¶
- Return type:
- onBeginInsertRows(self, parent: QModelIndex, first: int, last: int)¶
Does nothing except for calling
beginInsertRows()
Deprecated since version use:
beginInsertRows()
instead- Parameters:
parent (QModelIndex) –
first (int) –
last (int) –
- onBeginRemoveRows(self, parent: QModelIndex, first: int, last: int)¶
Does nothing except for calling
beginRemoveRows()
Deprecated since version Use:
beginRemoveRows()
instead- Parameters:
parent (QModelIndex) –
first (int) –
last (int) –
- onEndInsertRows(self, parent: QModelIndex, first: int, last: int)¶
Does nothing except for calling
endInsertRows()
Deprecated since version use:
endInsertRows()
instead- Parameters:
parent (QModelIndex) –
first (int) –
last (int) –
- onEndRemoveRows(self, parent: QModelIndex, first: int, last: int)¶
Does nothing except for calling
endRemoveRows()
Deprecated since version Use:
endRemoveRows()
instead- Parameters:
parent (QModelIndex) –
first (int) –
last (int) –
- parent(self, child: QModelIndex) QModelIndex ¶
- Parameters:
child (QModelIndex) –
- Return type:
QModelIndex
- parserErrorString(self) str ¶
Returns a detailed message about errors while parsing a
QgsExpression
.- Return type:
str
- Returns:
A message containing information about the parser error.
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters:
parent (QModelIndex = QModelIndex()) –
- Return type:
int
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setDisplayExpression(self, expression: str) bool ¶
- Parameters:
expression (str) – A
QgsExpression
compatible string.- Return type:
bool
- Returns:
True
if the expression could be set,False
if there was a parse error. If it fails, the old expression will still be applied. CallparserErrorString()
for a meaningful error message.
- setInjectNull(self, injectNull: bool)¶
If
True
is specified, a NULL value will be injected- Parameters:
injectNull (bool) – state of null value injection
Note
If set to
True
, the sort by display expression cannot be usedNew in version 2.9.
- setSortByDisplayExpression(self, sortByDisplayExpression: bool, order: Qt.SortOrder = Qt.AscendingOrder)¶
Sort this model by its display expression.
Note
Not compatible with injectNull, if sorting by display expression is enabled, injectNull will automatically turned off.
New in version 3.2.
- Parameters:
sortByDisplayExpression (bool) –
order (Qt.SortOrder = Qt.AscendingOrder) –
- setSourceModel(self, sourceModel: QgsAttributeTableFilterModel)¶
- Parameters:
sourceModel (QgsAttributeTableFilterModel) –
- sortByDisplayExpression(self) bool ¶
Sort this model by its display expression.
New in version 3.2.
- Return type:
bool
- timerEvent(self, QTimerEvent)¶