QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
vector
qgsfieldcalculator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfieldcalculator.h
3
---------------------
4
begin : September 2009
5
copyright : (C) 2009 by Marco Hugentobler
6
email : marco at hugis dot net
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSFIELDCALCULATOR_H
17
#define QGSFIELDCALCULATOR_H
18
19
#include "ui_qgsfieldcalculatorbase.h"
20
21
#include "qgis_gui.h"
22
#include "
qgsfields.h
"
23
#include "
qgshelp.h
"
24
25
class
QgsVectorLayer
;
26
class
QgsMessageBar
;
27
44
class
GUI_EXPORT
QgsFieldCalculator
:
public
QDialog,
private
Ui::QgsFieldCalculatorBase
45
{
46
Q_OBJECT
47
public
:
56
QgsFieldCalculator
(
QgsVectorLayer
*vl, QWidget *parent =
nullptr
,
int
fieldIndex = -1 );
57
63
int
changedAttributeId
()
const
{
return
mAttributeId; }
64
65
public
slots:
66
void
accept()
override
;
67
68
private
slots:
69
void
mNewFieldGroupBox_toggled(
bool
on );
70
void
mUpdateExistingGroupBox_toggled(
bool
on );
71
void
mCreateVirtualFieldCheckbox_stateChanged(
int
state );
72
void
mOutputFieldNameLineEdit_textChanged(
const
QString &text );
73
void
mOutputFieldTypeComboBox_activated(
int
index );
74
void
mExistingFieldComboBox_currentIndexChanged(
const
int
index );
75
77
void
setDialogButtonState();
78
void
setPrecisionMinMax();
79
void
showHelp();
80
void
calculate();
82
void
pushMessage(
const
QString &text,
Qgis::MessageLevel
level =
Qgis::MessageLevel::Info
,
int
duration = -1 );
83
84
private
:
86
QgsFieldCalculator
();
88
void
populateFields(
int
fieldIndex );
90
void
populateOutputFieldTypes();
91
92
QgsVectorLayer
*mVectorLayer =
nullptr
;
93
94
bool
mCanAddAttribute =
false
;
95
bool
mCanChangeAttributeValue =
false
;
96
98
QgsField
fieldDefinition();
99
101
int
mAttributeId;
102
103
QgsMessageBar
*mMsgBar =
nullptr
;
104
105
friend
class
TestQgsFieldCalculator
;
106
};
107
108
#endif
// QGSFIELDCALCULATOR_H
Qgis::MessageLevel
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition
qgis.h:160
Qgis::Info
@ Info
Information message.
Definition
qgis.h:161
QgsFieldCalculator
A dialog that provides calculation of new fields using existing fields, values and a set of operators...
Definition
qgsfieldcalculator.h:45
QgsFieldCalculator::changedAttributeId
int changedAttributeId() const
Returns the field index of the field for which new attribute values were calculated.
Definition
qgsfieldcalculator.h:63
QgsFieldCalculator::TestQgsFieldCalculator
friend class TestQgsFieldCalculator
Definition
qgsfieldcalculator.h:105
QgsFieldCalculator::QgsFieldCalculator
QgsFieldCalculator(QgsVectorLayer *vl, QWidget *parent=nullptr, int fieldIndex=-1)
Constructor for QgsFieldCalculator, with the specified parent widget.
Definition
qgsfieldcalculator.cpp:51
QgsField
Encapsulate a field in an attribute table or data source.
Definition
qgsfield.h:56
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition
qgsmessagebar.h:61
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgsfields.h
qgshelp.h
Generated on
for QGIS API Documentation by
1.17.0