Class: QgsAggregateMappingWidget¶
- class qgis.gui.QgsAggregateMappingWidget¶
Bases:
QgsPanelWidget
The
QgsAggregateMappingWidget
class creates a mapping for defining sets of aggregates of fields from aQgsFields
object.New in version 3.14.
QgsAggregateMappingWidget(parent: QWidget = None, sourceFields:
QgsFields
= QgsFields()) Constructs aQgsAggregateMappingWidget
from a set ofsourceFields
. Aparent
object can also be specified.Methods
Appends a new
field
to the model, with an optionalsource
andaggregate
Overridden key press event to handle the esc event on the widget.
Returns a list of Aggregate objects representing the current status of the underlying mapping model
Returns the underlying mapping model
Moves down currently selected field
Moves up currently selected field
Register an expression context
generator
class that will be used to retrieve an expression context for the widget.Removes the currently selected field from the model
Scroll the fields view to
index
Returns the selection model
Sets the
mapping
to show in the model.Set source fields of the underlying mapping model to
sourceFields
Sets a source
layer
to use when generating expression previews in the widget.Returns the source layer for use when generating expression previews.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- appendField(self, field: QgsField, source: str = '', aggregate: str = '')¶
Appends a new
field
to the model, with an optionalsource
andaggregate
- Parameters
field (QgsField) –
source (str = '') –
aggregate (str = '') –
- changeEvent(self, QEvent)¶
- changed¶
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
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, event: QKeyEvent)¶
Overridden key press event to handle the esc event on the widget.
- Parameters
event – The key event
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- mapping(self) List[QgsAggregateMappingModel.Aggregate] ¶
Returns a list of Aggregate objects representing the current status of the underlying mapping model
- Return type
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- model(self) QgsAggregateMappingModel ¶
Returns the underlying mapping model
- Return type
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- moveSelectedFieldsDown(self) bool ¶
Moves down currently selected field
- Return type
bool
- moveSelectedFieldsUp(self) bool ¶
Moves up currently selected field
- Return type
bool
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- registerExpressionContextGenerator(self, generator: QgsExpressionContextGenerator)¶
Register an expression context
generator
class that will be used to retrieve an expression context for the widget.- Parameters
generator (QgsExpressionContextGenerator) –
- removeSelectedFields(self) bool ¶
Removes the currently selected field from the model
- Return type
bool
- resizeEvent(self, QResizeEvent)¶
- scrollTo(self, index: QModelIndex)¶
Scroll the fields view to
index
- Parameters
index (QModelIndex) –
- selectionModel(self) QItemSelectionModel ¶
Returns the selection model
- Return type
QItemSelectionModel
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setMapping(self, mapping: Iterable[QgsAggregateMappingModel.Aggregate])¶
Sets the
mapping
to show in the model.- Parameters
mapping (Iterable[QgsAggregateMappingModel.Aggregate]) –
- setSourceFields(self, sourceFields: QgsFields)¶
Set source fields of the underlying mapping model to
sourceFields
- Parameters
sourceFields (QgsFields) –
- setSourceLayer(self, layer: QgsVectorLayer)¶
Sets a source
layer
to use when generating expression previews in the widget.New in version 3.16.
- Parameters
layer (QgsVectorLayer) –
- showEvent(self, QShowEvent)¶
- sourceLayer(self) QgsVectorLayer ¶
Returns the source layer for use when generating expression previews.
Returned value may be
None
.New in version 3.16.
- Return type
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶