Class: QgsFeatureListModel¶
Class Hierarchy¶
Base classes¶
Methods
Returns the model index corresponding to a feature ID. |
|
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. |
|
Does nothing except for calling |
|
Does nothing except for calling |
|
Does nothing except for calling |
|
Does nothing except for calling |
|
Returns a detailed message about errors while parsing a |
|
If |
|
Sort this model by its display expression. |
|
Sort this model by its display expression. |
Attributes
- class qgis.gui.QgsFeatureListModel(sourceModel: QgsAttributeTableFilterModel | None, parent: QObject | None = None)[source]¶
Bases:
QSortFilterProxyModel
,QgsFeatureModel
- class FeatureInfo¶
- class FeatureInfo(a0: QgsFeatureListModel.FeatureInfo)
Bases:
object
- isEdited¶
True if feature has been edited.
- isNew¶
True if feature is a newly added feature.
- FeatureInfoRole = 4096¶
- FeatureRole = 4097¶
- FeatureWithGeometryRole = 4098¶
- class Role¶
Bases:
int
- featureByIndex(self, index: QModelIndex, feat: QgsFeature) bool [source]¶
- Parameters:
index (QModelIndex)
feat (QgsFeature)
- Return type:
bool
- fidToIdx(self, fid: int) QModelIndex [source]¶
Returns the model index corresponding to a feature ID.
See also
- Parameters:
fid (int)
- Return type:
QModelIndex
- fidToIndexList(self, fid: int) List[QModelIndex] [source]¶
- Parameters:
fid (int)
- Return type:
List[QModelIndex]
- idxToFid(self, index: QModelIndex) int [source]¶
Returns the feature ID corresponding to an
index
from the model.See also
- Parameters:
index (QModelIndex)
- Return type:
int
- injectNull(self) bool [source]¶
Returns the current state of null value injection
- Return type:
bool
- Returns:
If a NULL value is added
- layerCache(self) QgsVectorLayerCache | None [source]¶
Returns the vector layer cache which is being used to populate the model.
- Return type:
Optional[QgsVectorLayerCache]
- mapFromMaster(self, sourceIndex: QModelIndex) QModelIndex [source]¶
- Parameters:
sourceIndex (QModelIndex)
- Return type:
QModelIndex
- mapSelectionFromMaster(self, selection: QItemSelection) QItemSelection [source]¶
- Parameters:
selection (QItemSelection)
- Return type:
QItemSelection
- mapSelectionToMaster(self, selection: QItemSelection) QItemSelection [source]¶
- Parameters:
selection (QItemSelection)
- Return type:
QItemSelection
- mapToMaster(self, proxyIndex: QModelIndex) QModelIndex [source]¶
- Parameters:
proxyIndex (QModelIndex)
- Return type:
QModelIndex
- masterModel(self) QgsAttributeTableModel | None [source]¶
- Return type:
Optional[QgsAttributeTableModel]
- onBeginInsertRows(self, parent: QModelIndex, first: int, last: int)[source]¶
Does nothing except for calling
beginInsertRows()
Deprecated since version 3.40: Use
beginInsertRows()
instead.- Parameters:
parent (QModelIndex)
first (int)
last (int)
- onBeginRemoveRows(self, parent: QModelIndex, first: int, last: int)[source]¶
Does nothing except for calling
beginRemoveRows()
Deprecated since version 3.40: Use
beginRemoveRows()
instead.- Parameters:
parent (QModelIndex)
first (int)
last (int)
- onEndInsertRows(self, parent: QModelIndex, first: int, last: int)[source]¶
Does nothing except for calling
endInsertRows()
Deprecated since version 3.40: Use
endInsertRows()
instead.- Parameters:
parent (QModelIndex)
first (int)
last (int)
- onEndRemoveRows(self, parent: QModelIndex, first: int, last: int)[source]¶
Does nothing except for calling
endRemoveRows()
Deprecated since version 3.40: Use
endRemoveRows()
instead.- Parameters:
parent (QModelIndex)
first (int)
last (int)
- parserErrorString(self) str [source]¶
Returns a detailed message about errors while parsing a
QgsExpression
.- Return type:
str
- Returns:
A message containing information about the parser error.
- setDisplayExpression(self, expression: str | None) bool [source]¶
- Parameters:
expression (Optional[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)[source]¶
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 used
- setSortByDisplayExpression(self, sortByDisplayExpression: bool, order: Qt.SortOrder = Qt.AscendingOrder)[source]¶
Sort this model by its display expression.
Note
Not compatible with injectNull, if sorting by display expression is enabled, injectNull will automatically turned off.
Added in version 3.2.
- Parameters:
sortByDisplayExpression (bool)
order (Qt.SortOrder = Qt.AscendingOrder)