QGIS API Documentation
3.14.0-Pi (9f7028fd23)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
n
o
p
q
r
s
t
u
w
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsvectorlayerundocommand.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectorlayerundocommand.h
3
---------------------
4
begin : June 2009
5
copyright : (C) 2009 by Martin Dobias
6
email : wonder dot sk at gmail dot com
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 QGSVECTORLAYERUNDOCOMMAND_H
17
#define QGSVECTORLAYERUNDOCOMMAND_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
#include <QUndoCommand>
22
23
#include <QVariant>
24
#include <QSet>
25
#include <QList>
26
27
#include "
qgsfields.h
"
28
#include "
qgsfeature.h
"
29
30
class
QgsGeometry
;
31
32
#include "
qgsvectorlayereditbuffer.h
"
33
40
class
CORE_EXPORT
QgsVectorLayerUndoCommand
:
public
QUndoCommand
41
{
42
public
:
43
48
QgsVectorLayerUndoCommand
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
)
49
: mBuffer( buffer )
50
{}
51
53
inline
QgsVectorLayer
*
layer
() {
return
mBuffer->L; }
54
55
int
id
()
const override
{
return
-1; }
56
bool
mergeWith
(
const
QUndoCommand * )
override
{
return
false
; }
57
58
protected
:
60
QgsVectorLayerEditBuffer
*mBuffer =
nullptr
;
61
};
62
63
70
class
CORE_EXPORT
QgsVectorLayerUndoCommandAddFeature
:
public
QgsVectorLayerUndoCommand
71
{
72
public
:
73
79
QgsVectorLayerUndoCommandAddFeature
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
QgsFeature
&f );
80
81
void
undo()
override
;
82
void
redo()
override
;
83
84
private
:
85
QgsFeature
mFeature;
86
};
87
88
95
class
CORE_EXPORT
QgsVectorLayerUndoCommandDeleteFeature
:
public
QgsVectorLayerUndoCommand
96
{
97
public
:
98
104
QgsVectorLayerUndoCommandDeleteFeature
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
QgsFeatureId
fid );
105
106
void
undo()
override
;
107
void
redo()
override
;
108
109
private
:
110
QgsFeatureId
mFid;
111
QgsFeature
mOldAddedFeature;
112
};
113
120
class
CORE_EXPORT
QgsVectorLayerUndoCommandChangeGeometry
:
public
QgsVectorLayerUndoCommand
121
{
122
public
:
123
130
QgsVectorLayerUndoCommandChangeGeometry
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
QgsFeatureId
fid,
const
QgsGeometry
&newGeom );
131
132
void
undo()
override
;
133
void
redo()
override
;
134
int
id
()
const override
;
135
bool
mergeWith
(
const
QUndoCommand * )
override
;
136
137
private
:
138
QgsFeatureId
mFid;
139
QgsGeometry
mOldGeom;
140
mutable
QgsGeometry
mNewGeom;
141
};
142
143
150
class
CORE_EXPORT
QgsVectorLayerUndoCommandChangeAttribute
:
public
QgsVectorLayerUndoCommand
151
{
152
public
:
153
162
QgsVectorLayerUndoCommandChangeAttribute
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
QgsFeatureId
fid,
int
fieldIndex,
const
QVariant &newValue,
const
QVariant &oldValue );
163
void
undo()
override
;
164
void
redo()
override
;
165
166
private
:
167
QgsFeatureId
mFid;
168
int
mFieldIndex;
169
QVariant mOldValue;
170
QVariant mNewValue;
171
bool
mFirstChange;
172
};
173
180
class
CORE_EXPORT
QgsVectorLayerUndoCommandAddAttribute
:
public
QgsVectorLayerUndoCommand
181
{
182
public
:
183
189
QgsVectorLayerUndoCommandAddAttribute
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
const
QgsField
&field );
190
191
void
undo()
override
;
192
void
redo()
override
;
193
194
private
:
195
QgsField
mField;
196
int
mFieldIndex;
197
};
198
205
class
CORE_EXPORT
QgsVectorLayerUndoCommandDeleteAttribute
:
public
QgsVectorLayerUndoCommand
206
{
207
public
:
208
214
QgsVectorLayerUndoCommandDeleteAttribute
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
int
fieldIndex );
215
216
void
undo()
override
;
217
void
redo()
override
;
218
219
private
:
220
int
mFieldIndex;
221
QString mFieldName;
222
bool
mProviderField;
223
int
mOriginIndex;
224
QgsField
mOldField;
225
QVariantMap mOldEditorWidgetConfig;
226
227
QMap<QgsFeatureId, QVariant> mDeletedValues;
228
QString mOldName;
229
};
230
231
239
class
CORE_EXPORT
QgsVectorLayerUndoCommandRenameAttribute
:
public
QgsVectorLayerUndoCommand
240
{
241
public
:
242
249
QgsVectorLayerUndoCommandRenameAttribute
(
QgsVectorLayerEditBuffer
*buffer
SIP_TRANSFER
,
int
fieldIndex,
const
QString &newName );
250
251
void
undo()
override
;
252
void
redo()
override
;
253
254
private
:
255
int
mFieldIndex;
256
bool
mProviderField;
257
int
mOriginIndex;
258
QString mOldName;
259
QString mNewName;
260
};
261
262
#endif
qgsfields.h
QgsVectorLayerUndoCommandRenameAttribute
Undo command for renaming an existing attribute of a vector layer.
Definition:
qgsvectorlayerundocommand.h:239
QgsVectorLayerUndoCommandAddAttribute
Undo command for adding a new attribute to a vector layer.
Definition:
qgsvectorlayerundocommand.h:180
qgsfeature.h
QgsVectorLayerUndoCommandAddFeature
Undo command for adding a feature to a vector layer.
Definition:
qgsvectorlayerundocommand.h:70
QgsVectorLayerUndoCommand::QgsVectorLayerUndoCommand
QgsVectorLayerUndoCommand(QgsVectorLayerEditBuffer *buffer)
Constructor for QgsVectorLayerUndoCommand.
Definition:
qgsvectorlayerundocommand.h:48
QgsVectorLayerUndoCommand::layer
QgsVectorLayer * layer()
Returns the layer associated with the undo command.
Definition:
qgsvectorlayerundocommand.h:53
qgis_sip.h
QgsVectorLayerUndoCommand::id
int id() const override
Definition:
qgsvectorlayerundocommand.h:55
SIP_TRANSFER
#define SIP_TRANSFER
Definition:
qgis_sip.h:36
QgsVectorLayerUndoCommandChangeGeometry
Undo command for modifying the geometry of a feature from a vector layer.
Definition:
qgsvectorlayerundocommand.h:120
QgsVectorLayerUndoCommandDeleteAttribute
Undo command for removing an existing attribute from a vector layer.
Definition:
qgsvectorlayerundocommand.h:205
QgsVectorLayerUndoCommand
Base class for undo commands within a QgsVectorLayerEditBuffer.
Definition:
qgsvectorlayerundocommand.h:40
QgsGeometry
Definition:
qgsgeometry.h:122
QgsVectorLayerUndoCommandDeleteFeature
Undo command for deleting a feature from a vector layer.
Definition:
qgsvectorlayerundocommand.h:95
QgsVectorLayerUndoCommand::mergeWith
bool mergeWith(const QUndoCommand *) override
Definition:
qgsvectorlayerundocommand.h:56
QgsVectorLayerEditBuffer
Definition:
qgsvectorlayereditbuffer.h:36
QgsVectorLayer
Definition:
qgsvectorlayer.h:385
QgsFeature
Definition:
qgsfeature.h:55
QgsVectorLayerUndoCommandChangeAttribute
Undo command for modifying an attribute of a feature from a vector layer.
Definition:
qgsvectorlayerundocommand.h:150
qgsvectorlayereditbuffer.h
QgsFeatureId
qint64 QgsFeatureId
Definition:
qgsfeatureid.h:25
QgsField
Definition:
qgsfield.h:49
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17