QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Friends | List of all members
QgsFieldCalculator Class Reference

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

#include <qgsfieldcalculator.h>

Inheritance diagram for QgsFieldCalculator:
Inheritance graph
[legend]

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

Definition at line 43 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 176 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 54 of file qgsfieldcalculator.h.

Friends And Related Symbol Documentation

◆ TestQgsFieldCalculator

friend class TestQgsFieldCalculator
friend

Definition at line 96 of file qgsfieldcalculator.h.


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