QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsFieldCalculator Class Reference

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

#include <qgsfieldcalculator.h>

Inheritance diagram for QgsFieldCalculator:

Public Slots

void accept () override

Public Member Functions

 QgsFieldCalculator (QgsVectorLayer *vl, QWidget *parent=nullptr)
int changedAttributeId () const
 Returns the field index of the field for which new attribute values were calculated.

Friends

class TestQgsFieldCalculator

Detailed Description

A dialog 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()
A dialog that provides calculation of new fields using existing fields, values and a set of operators...
Represents a vector layer which manages a vector based dataset.

Definition at line 44 of file qgsfieldcalculator.h.

Constructor & Destructor Documentation

◆ QgsFieldCalculator()

QgsFieldCalculator::QgsFieldCalculator ( QgsVectorLayer * vl,
QWidget * parent = nullptr )

Definition at line 48 of file qgsfieldcalculator.cpp.

Member Function Documentation

◆ accept

void QgsFieldCalculator::accept ( )
overrideslot

Definition at line 177 of file qgsfieldcalculator.cpp.

◆ changedAttributeId()

int QgsFieldCalculator::changedAttributeId ( ) const
inline

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

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

Definition at line 55 of file qgsfieldcalculator.h.

◆ TestQgsFieldCalculator

friend class TestQgsFieldCalculator
friend

Definition at line 97 of file qgsfieldcalculator.h.


The documentation for this class was generated from the following files: