Class: QgsFieldCalculator

class qgis.gui.QgsFieldCalculator

Bases: PyQt5.QtWidgets.QDialog

A dialog class that provides calculation of new fields using existing fields, values and a set of operators

Sample usage of the QgsFieldCalculator class:

        uri = "point?crs=epsg:4326&field=id:integer"
        layer = QgsVectorLayer(uri, "Scratch point layer",  "memory")
        layer.startEditing()
        dialog = QgsFieldCalculator(layer)
        dialog.exec_()

.. autoautosummary:: qgis.gui.QgsFieldCalculator
    :enums:
    :nosignatures:

.. autoautosummary:: qgis.gui.QgsFieldCalculator
    :methods:
    :nosignatures:

.. autoautosummary:: qgis.gui.QgsFieldCalculator
    :signals:
    :nosignatures:

.. autoautosummary:: qgis.gui.QgsFieldCalculator
    :attributes:
accept(self)
actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
changedAttributeId(self) int

Returns the field index of the field for which new attribute values were calculated.

Return type

int

Returns

The field index if attribute values were calculated or -1, e.g. in case of geometry changes.

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
eventFilter(self, QObject, 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, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)