Subgroup: Feature

Class: QgsFeatureListModel

class qgis.gui.QgsFeatureListModel(sourceModel: QgsAttributeTableFilterModel, parent: QObject = None)

Bases: PyQt5.QtCore.QSortFilterProxyModel, qgis._gui.QgsFeatureModel

Constructor for QgsFeatureListModel

Methods

beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
beginResetModel
changePersistentIndex
changePersistentIndexList
childEvent
columnCount
connectNotify
createIndex
customEvent
data
decodeData
disconnectNotify
displayExpression
encodeData
endInsertColumns
endInsertRows
endMoveColumns
endMoveRows
endRemoveColumns
endRemoveRows
endResetModel
featureByIndex
fidToIdx Returns the model index corresponding to a feature ID.
fidToIndex
fidToIndexList
filterAcceptsColumn
filterAcceptsRow
flags
idxToFid Returns the feature ID corresponding to an index from the model.
injectNull Returns the current state of null value injection
invalidateFilter
isSignalConnected
layerCache Returns the vector layer cache which is being used to populate the model.
lessThan
mapFromMaster
mapFromSource
mapSelectionFromMaster
mapSelectionToMaster
mapToMaster
mapToSource
masterModel
onBeginInsertRows Does nothing except for calling beginInsertRows()
onBeginRemoveRows Does nothing except for calling beginRemoveRows()
onEndInsertRows Does nothing except for calling endInsertRows()
onEndRemoveRows Does nothing except for calling endRemoveRows()
parent
parserErrorString Returns a detailed message about errors while parsing a QgsExpression.
persistentIndexList
receivers
resetInternalData
rowCount
sender
senderSignalIndex
setDisplayExpression
param expression:
 A QgsExpression compatible string.
setInjectNull If true is specified, a NULL value will be injected
setSortByDisplayExpression Sort this model by its display expression.
setSourceModel
sortByDisplayExpression Sort this model by its display expression.
timerEvent

Signals

Attributes

FeatureInfoRole
FeatureRole
class FeatureInfo

Bases: sip.wrapper

Constructor for FeatureInfo.

QgsFeatureListModel.FeatureInfo(QgsFeatureListModel.FeatureInfo)

isEdited
isNew
FeatureInfoRole = 4096
FeatureRole = 4097
class Role

Bases: int

beginInsertColumns()
beginInsertRows()
beginMoveColumns()
beginMoveRows()
beginRemoveColumns()
beginRemoveRows()
beginResetModel()
changePersistentIndex()
changePersistentIndexList()
childEvent()
columnCount(self, parent: QModelIndex = QModelIndex()) → int
connectNotify()
createIndex()
customEvent()
data(self, index: QModelIndex, role: int) → Any
decodeData()
disconnectNotify()
displayExpression(self) → str
encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
featureByIndex(self, index: QModelIndex, feat: QgsFeature) → bool
fidToIdx(self, fid: int) → QModelIndex

Returns the model index corresponding to a feature ID.

See also

idxToFid()

fidToIndex(self, fid: int) → QModelIndex
fidToIndexList(self, fid: int) → object
filterAcceptsColumn()
filterAcceptsRow()
flags(self, index: QModelIndex) → Qt.ItemFlags
idxToFid(self, index: QModelIndex) → int

Returns the feature ID corresponding to an index from the model.

See also

fidToIdx()

injectNull(self) → bool

Returns the current state of null value injection

Returns:If a NULL value is added

New in version 2.9.

invalidateFilter()
isSignalConnected()
layerCache(self) → QgsVectorLayerCache

Returns the vector layer cache which is being used to populate the model.

lessThan()
mapFromMaster(self, sourceIndex: QModelIndex) → QModelIndex
mapFromSource(self, sourceIndex: QModelIndex) → QModelIndex
mapSelectionFromMaster(self, selection: QItemSelection) → QItemSelection
mapSelectionToMaster(self, selection: QItemSelection) → QItemSelection
mapToMaster(self, proxyIndex: QModelIndex) → QModelIndex
mapToSource(self, proxyIndex: QModelIndex) → QModelIndex
masterModel(self) → QgsAttributeTableModel
onBeginInsertRows(self, parent: QModelIndex, first: int, last: int)

Does nothing except for calling beginInsertRows()

Deprecated since version use: beginInsertRows() instead

onBeginRemoveRows(self, parent: QModelIndex, first: int, last: int)

Does nothing except for calling beginRemoveRows()

Deprecated since version Use: beginRemoveRows() instead

onEndInsertRows(self, parent: QModelIndex, first: int, last: int)

Does nothing except for calling endInsertRows()

Deprecated since version use: endInsertRows() instead

onEndRemoveRows(self, parent: QModelIndex, first: int, last: int)

Does nothing except for calling endRemoveRows()

Deprecated since version Use: endRemoveRows() instead

parent(self, child: QModelIndex) → QModelIndex
parserErrorString(self) → str

Returns a detailed message about errors while parsing a QgsExpression.

Returns:A message containing information about the parser error.
persistentIndexList()
receivers()
resetInternalData()
rowCount(self, parent: QModelIndex = QModelIndex()) → int
sender()
senderSignalIndex()
setDisplayExpression(self, expression: str) → bool
Parameters:expression – A QgsExpression compatible string.
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. Call parserErrorString() for a meaningful error message.
setInjectNull(self, injectNull: bool)

If true is specified, a NULL value will be injected

Parameters:injectNull – state of null value injection

New in version 2.9.

setSortByDisplayExpression(self, sortByDisplayExpression: bool)

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.

setSourceModel(self, sourceModel: QgsAttributeTableFilterModel)
sortByDisplayExpression(self) → bool

Sort this model by its display expression.

New in version 3.2.

timerEvent()