Class: QgsAggregateMappingModel¶
- class qgis.gui.QgsAggregateMappingModel¶
Bases:
PyQt5.QtCore.QAbstractTableModel
The
QgsAggregateMappingModel
holds mapping information for defining sets of aggregates of fields from aQgsFields
object.New in version 3.14.
QgsAggregateMappingModel(sourceFields:
QgsFields
= QgsFields(), parent: QObject = None) Constructs aQgsAggregateMappingModel
from a set ofsourceFields
. Aparent
object can be also specified.Enums
Bases:
enum.IntEnum
Methods
Appends a new
field
to the model, with an optionalsource
andaggregate
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
changePersistentIndex
- param parent
Returns the context generator with the source fields
createIndex
- param index
decodeData
- param index
- param section
Returns a list of Aggregate objects representing the current status of the model
Moves up the field at
index
Moves down the field at
index
Removes the field at
index
from the model, returnsTrue
on success- param parent
Sets the base expression context
generator
, which will generate the expression contexts for expression based widgets used by the model.- param index
Sets the
mapping
to show in the model.Set source fields to
sourceFields
Returns a list of source fields
- class Aggregate¶
- class Aggregate(QgsAggregateMappingModel.Aggregate) None
Bases:
sip.wrapper
- aggregate¶
- delimiter¶
- field¶
- source¶
- class ColumnDataIndex(value)¶
Bases:
enum.IntEnum
The ColumnDataIndex enum represents the column index for the view
SourceExpression
: ExpressionAggregate
: Aggregate nameDelimiter
: DelimiterDestinationName
: Destination field nameDestinationType
: Destination field QVariant::Type casted to (int)DestinationLength
: Destination field lengthDestinationPrecision
: Destination field precision
- Aggregate = 1¶
- Delimiter = 2¶
- DestinationLength = 5¶
- DestinationName = 3¶
- DestinationPrecision = 6¶
- DestinationType = 4¶
- SourceExpression = 0¶
- baseClass¶
alias of
qgis._gui.QgsAggregateMappingModel
- 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 = '') –
- QgsAggregateMappingModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsAggregateMappingModel.beginInsertRows(self, QModelIndex, int, int)
- QgsAggregateMappingModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsAggregateMappingModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsAggregateMappingModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsAggregateMappingModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- QgsAggregateMappingModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- columnCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- connectNotify(self, QMetaMethod)¶
- contextGenerator(self) QgsExpressionContextGenerator ¶
Returns the context generator with the source fields
- Return type
- QgsAggregateMappingModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters
index (QModelIndex) –
role (int) –
- Return type
Any
- QgsAggregateMappingModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
- disconnectNotify(self, QMetaMethod)¶
- encodeData(self, Iterable[QModelIndex], QDataStream)¶
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- flags(self, index: QModelIndex) Qt.ItemFlags ¶
- Parameters
index (QModelIndex) –
- Return type
Qt.ItemFlags
- headerData(self, section: int, orientation: Qt.Orientation, role: int) Any ¶
- Parameters
section (int) –
orientation (Qt.Orientation) –
role (int) –
- Return type
Any
- isSignalConnected(self, QMetaMethod) bool ¶
- mapping(self) List[QgsAggregateMappingModel.Aggregate] ¶
Returns a list of Aggregate objects representing the current status of the model
- Return type
- moveDown(self, index: QModelIndex) bool ¶
Moves up the field at
index
- Parameters
index (QModelIndex) –
- Return type
bool
- moveUp(self, index: QModelIndex) bool ¶
Moves down the field at
index
- Parameters
index (QModelIndex) –
- Return type
bool
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, PYQT_SIGNAL) int ¶
- removeField(self, index: QModelIndex) bool ¶
Removes the field at
index
from the model, returnsTrue
on success- Parameters
index (QModelIndex) –
- Return type
bool
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBaseExpressionContextGenerator(self, generator: QgsExpressionContextGenerator)¶
Sets the base expression context
generator
, which will generate the expression contexts for expression based widgets used by the model.- Parameters
generator (QgsExpressionContextGenerator) –
- setData(self, index: QModelIndex, value: Any, role: int) bool ¶
- Parameters
index (QModelIndex) –
value (Any) –
role (int) –
- Return type
bool
- 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 to
sourceFields
- Parameters
sourceFields (QgsFields) –
- timerEvent(self, QTimerEvent)¶