Class: QgsFeatureListView¶
Shows a list of features and renders a edit button next to each feature.
Accepts a display expression to define the way, features are rendered.
Uses a QgsFeatureListModel
as source model.
Class Hierarchy¶
Base classes¶
Methods
Gets the currentEditSelection |
|
Returns the expression which is currently used to render the features. |
|
editFirstFeature will try to edit the first feature of the list |
|
editLastFeature will try to edit the last feature of the list |
|
editNextFeature will try to edit next feature of the list |
|
editPreviousFeature will try to edit previous feature of the list |
|
Gets the featureListModel used by this view |
|
Returns the layer cache |
|
Returns a detailed message about errors while parsing a |
|
Select all currently visible features |
|
Sets if the currently shown form has received any edit events so far. |
|
The display expression is an expression used to render the fields into a single string which is displaied. |
|
Set the feature(s) to be edited |
|
setFeatureSelectionManager |
|
Set the |
Signals
Emitted whenever the current edit selection has been changed. |
|
Emitted whenever the current edit selection has been changed. |
|
Emitted whenever the display expression is successfully changed |
|
Emitted when the context menu is created to add the specific actions to it |
- class qgis.gui.QgsFeatureListView[source]¶
Bases:
QListView
- __init__(parent: QWidget | None = None)
Creates a feature list view
- Parameters:
parent (Optional[QWidget] = None) – owner
- currentEditSelection(self) Any [source]¶
Gets the currentEditSelection
- Return type:
Any
- Returns:
A list of edited feature ids
- signal currentEditSelectionChanged(feat: QgsFeature)[source]¶
Emitted whenever the current edit selection has been changed.
- Parameters:
feat (QgsFeature) – the feature, which will be edited.
- signal currentEditSelectionProgressChanged(progress: int, count: int)[source]¶
Emitted whenever the current edit selection has been changed.
- Parameters:
progress (int) – the position of the feature in the list
count (int) – the number of features in the list
Added in version 3.8.
- displayExpression(self) str [source]¶
Returns the expression which is currently used to render the features.
- Return type:
str
- Returns:
A string containing the currend display expression
See also
- signal displayExpressionChanged(expression: str)[source]¶
Emitted whenever the display expression is successfully changed
- Parameters:
expression (str) – The expression that was applied
- editFirstFeature(self)[source]¶
editFirstFeature will try to edit the first feature of the list
Added in version 3.8.
- editLastFeature(self)[source]¶
editLastFeature will try to edit the last feature of the list
Added in version 3.8.
- editNextFeature(self)[source]¶
editNextFeature will try to edit next feature of the list
Added in version 3.8.
- editPreviousFeature(self)[source]¶
editPreviousFeature will try to edit previous feature of the list
Added in version 3.8.
- featureListModel(self) QgsFeatureListModel | None [source]¶
Gets the featureListModel used by this view
- Return type:
Optional[QgsFeatureListModel]
- Returns:
The model in use
- layerCache(self) QgsVectorLayerCache | None [source]¶
Returns the layer cache
- Return type:
Optional[QgsVectorLayerCache]
- Returns:
the layer cache used as backend
- 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.
- repaintRequested(self, indexes: Iterable[QModelIndex])[source]¶
- repaintRequested(self) None
- Parameters:
indexes (Iterable[QModelIndex])
- repaintRequested(self)[source]
- setCurrentFeatureEdited(self, state: bool)[source]¶
Sets if the currently shown form has received any edit events so far.
- Parameters:
state (bool) – The state
- setDisplayExpression(self, displayExpression: str | None) bool [source]¶
The display expression is an expression used to render the fields into a single string which is displaied.
- Parameters:
displayExpression (Optional[str]) – The expression used to render the feature
See also
- Return type:
bool
- setEditSelection(self, fids: Any)[source]¶
Set the feature(s) to be edited
- Parameters:
fids (Any) – A list of features to be edited
- setEditSelection(self, index: QModelIndex, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag)[source]
Set the feature(s) to be edited
- Parameters:
index (QModelIndex) – The selection to set
command (Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag]) – selection update mode
- setFeatureSelectionManager(self, featureSelectionManager: QgsIFeatureSelectionManager | None)[source]¶
- setFeatureSelectionManager(None) None
- Parameters:
featureSelectionManager (Optional[QgsIFeatureSelectionManager])
- setModel(self, featureListModel: QgsFeatureListModel | None)[source]¶
Set the
QgsFeatureListModel
which is used to retrieve information- Parameters:
featureListModel (Optional[QgsFeatureListModel]) – The model to use
- signal willShowContextMenu(menu: QgsActionMenu, atIndex: QModelIndex)[source]¶
Emitted when the context menu is created to add the specific actions to it
- Parameters:
menu (QgsActionMenu) – is the already created context menu
atIndex (QModelIndex) – is the position of the current feature in the model