Class: QgsFeatureListModel

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

Bases: PyQt5.QtCore.QSortFilterProxyModel, QgsFeatureModel

Constructor for QgsFeatureListModel

Parameters
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
Parameters

parent (QModelIndex = QModelIndex()) –

Return type

int

connectNotify()
createIndex()
customEvent()
data(self, index: QModelIndex, role: int) → Any
Parameters
  • index (QModelIndex) –

  • role (int) –

Return type

Any

decodeData()
disconnectNotify()
displayExpression(self) → str
Return type

str

encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
featureByIndex(self, index: QModelIndex, feat: QgsFeature) → bool
Parameters
Return type

bool

fidToIdx(self, fid: int) → QModelIndex

Returns the model index corresponding to a feature ID.

See also

idxToFid()

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()
filterAcceptsRow()
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

fidToIdx()

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()
isSignalConnected()
layerCache(self) → QgsVectorLayerCache

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

Return type

QgsVectorLayerCache

lessThan()
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

QgsAttributeTableModel

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()
receivers()
resetInternalData()
rowCount(self, parent: QModelIndex = QModelIndex()) → int
Parameters

parent (QModelIndex = QModelIndex()) –

Return type

int

sender()
senderSignalIndex()
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. Call parserErrorString() 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

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.

Parameters

sortByDisplayExpression (bool) –

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()