Class: QgsFeatureListView¶
- class qgis.gui.QgsFeatureListView¶
Bases:
PyQt5.QtWidgets.QListView
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.QgsFeatureListView(parent: QWidget = None) Creates a feature list view
- Parameters:
parent –
owner
Methods
- param event:
currentChanged
Gets the currentEditSelection
dataChanged
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
- param event:
Returns the layer cache
- param event:
- param event:
- param event:
Returns a detailed message about errors while parsing a
QgsExpression
.- param indexes:
rowsAboutToBeRemoved
rowsInserted
scrollContentsBy
scrollDirtyRegion
Select all currently visible features
selectionChanged
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
- type featureSelectionManager:
QgsIFeatureSelectionManager
Set the
QgsFeatureListModel
which is used to retrieve informationSignals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEditor(self, QWidget, QAbstractItemDelegate.EndEditHint)¶
- closeEvent(self, QCloseEvent)¶
- commitData(self, QWidget)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, event: QContextMenuEvent)¶
- Parameters:
event (QContextMenuEvent) –
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- QgsFeatureListView.currentChanged(self, QModelIndex, QModelIndex)
- currentEditSelection(self) object ¶
Gets the currentEditSelection
- Return type:
object
- Returns:
A list of edited feature ids
- currentEditSelectionChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- currentEditSelectionProgressChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- customEvent(self, QEvent)¶
- QgsFeatureListView.dataChanged(self, QModelIndex, QModelIndex, roles: Iterable[int] = [])
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- dirtyRegionOffset(self) QPoint ¶
- disconnectNotify(self, QMetaMethod)¶
- displayExpression(self) str ¶
Returns the expression which is currently used to render the features.
- Return type:
str
- Returns:
A string containing the currend display expression
See also
- displayExpressionChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- drawFrame(self, QPainter)¶
- dropEvent(self, QDropEvent)¶
- dropIndicatorPosition(self) QAbstractItemView.DropIndicatorPosition ¶
- edit(self, QModelIndex)¶
- edit(self, QModelIndex, QAbstractItemView.EditTrigger, QEvent) bool
- editFirstFeature(self)¶
editFirstFeature will try to edit the first feature of the list
New in version 3.8.
- editLastFeature(self)¶
editLastFeature will try to edit the last feature of the list
New in version 3.8.
- editNextFeature(self)¶
editNextFeature will try to edit next feature of the list
New in version 3.8.
- editPreviousFeature(self)¶
editPreviousFeature will try to edit previous feature of the list
New in version 3.8.
- editorDestroyed(self, QObject)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- executeDelayedItemsLayout(self)¶
- featureListModel(self) QgsFeatureListModel ¶
Gets the featureListModel used by this view
- Return type:
- Returns:
The model in use
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- horizontalOffset(self) int ¶
- horizontalScrollbarAction(self, int)¶
- horizontalScrollbarValueChanged(self, int)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionFrame)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isIndexHidden(self, QModelIndex) bool ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, event: QKeyEvent)¶
- Parameters:
event (QKeyEvent) –
- keyReleaseEvent(self, QKeyEvent)¶
- layerCache(self) QgsVectorLayerCache ¶
Returns the layer cache
- Return type:
- Returns:
the layer cache used as backend
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, event: QMouseEvent)¶
- Parameters:
event (QMouseEvent) –
- mousePressEvent(self, event: QMouseEvent)¶
- Parameters:
event (QMouseEvent) –
- mouseReleaseEvent(self, event: QMouseEvent)¶
- Parameters:
event (QMouseEvent) –
- moveCursor(self, QAbstractItemView.CursorAction, Union[Qt.KeyboardModifiers, Qt.KeyboardModifier]) QModelIndex ¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- 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.
- receivers(self, PYQT_SIGNAL) int ¶
- rectForIndex(self, QModelIndex) QRect ¶
- repaintRequested(self, indexes: Iterable[QModelIndex])¶
- repaintRequested(self) None
- Parameters:
indexes (Iterable[QModelIndex]) –
- resizeEvent(self, QResizeEvent)¶
- QgsFeatureListView.rowsAboutToBeRemoved(self, QModelIndex, int, int)
- QgsFeatureListView.rowsInserted(self, QModelIndex, int, int)
- scheduleDelayedItemsLayout(self)¶
- QgsFeatureListView.scrollContentsBy(self, int, int)
- QgsFeatureListView.scrollDirtyRegion(self, int, int)
- selectAll(self)¶
Select all currently visible features
- selectedIndexes(self) List[QModelIndex] ¶
- QgsFeatureListView.selectionChanged(self, QItemSelection, QItemSelection)
- selectionCommand(self, QModelIndex, event: QEvent = None) QItemSelectionModel.SelectionFlags ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setCurrentFeatureEdited(self, state: bool)¶
Sets if the currently shown form has received any edit events so far.
- Parameters:
state (bool) – The state
- setDirtyRegion(self, QRegion)¶
- setDisplayExpression(self, displayExpression: str) bool ¶
The display expression is an expression used to render the fields into a single string which is displaied.
- Parameters:
displayExpression (str) – The expression used to render the feature
See also
- Return type:
bool
- setEditSelection(self, fids: object)¶
Set the feature(s) to be edited
- Parameters:
fids (object) – A list of features to be edited
setEditSelection(self, index: QModelIndex, command: Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag]) Set the feature(s) to be edited
- Parameters:
index – The selection to set
command – selection update mode
- setFeatureSelectionManager(self, featureSelectionManager: QgsIFeatureSelectionManager)¶
- setFeatureSelectionManager(None) None
- Parameters:
featureSelectionManager (QgsIFeatureSelectionManager) –
- setModel(self, featureListModel: QgsFeatureListModel)¶
Set the
QgsFeatureListModel
which is used to retrieve information- Parameters:
featureListModel (QgsFeatureListModel) – The model to use
- setPositionForIndex(self, QPoint, QModelIndex)¶
- setSelection(self, QRect, Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag])¶
- setState(self, QAbstractItemView.State)¶
- QgsFeatureListView.setViewportMargins(self, int, int, int, int)
- setViewportMargins(self, QMargins) None ¶
- showEvent(self, QShowEvent)¶
- startDrag(self, Union[Qt.DropActions, Qt.DropAction])¶
- state(self) QAbstractItemView.State ¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateEditorData(self)¶
- updateEditorGeometries(self)¶
- updateGeometries(self)¶
- updateMicroFocus(self)¶
- verticalOffset(self) int ¶
- verticalScrollbarAction(self, int)¶
- verticalScrollbarValueChanged(self, int)¶
- viewOptions(self) QStyleOptionViewItem ¶
- viewportEvent(self, QEvent) bool ¶
- viewportMargins(self) QMargins ¶
- viewportSizeHint(self) QSize ¶
- visualRegionForSelection(self, QItemSelection) QRegion ¶
- wheelEvent(self, QWheelEvent)¶
- willShowContextMenu¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL