QGIS API Documentation
3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
src
gui
maptools
qgsmaptoolshapeabstract.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaptoolshapeabstract.cpp
3
----------------------
4
begin : January 2022
5
copyright : (C) 2022 by Denis Rouzaud
6
email :
[email protected]
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#include "
qgsmaptoolshapeabstract.h
"
19
20
#include "
qgsgeometryrubberband.h
"
21
22
#include <QKeyEvent>
23
24
#include "moc_qgsmaptoolshapeabstract.cpp"
25
26
QgsMapToolShapeAbstract::~QgsMapToolShapeAbstract
()
27
{
28
clean
();
29
}
30
31
void
QgsMapToolShapeAbstract::keyPressEvent
( QKeyEvent *e )
32
{
33
e->ignore();
34
}
35
36
void
QgsMapToolShapeAbstract::keyReleaseEvent
( QKeyEvent *e )
37
{
38
e->ignore();
39
}
40
41
void
QgsMapToolShapeAbstract::clean
()
42
{
43
if
(
mTempRubberBand
)
44
{
45
delete
mTempRubberBand
;
46
mTempRubberBand
=
nullptr
;
47
}
48
49
mPoints
.clear();
50
}
51
52
void
QgsMapToolShapeAbstract::undo
()
53
{
54
if
(
mPoints
.count() == 1 )
55
clean
();
56
else
if
(
mPoints
.count() > 1 )
57
mPoints
.removeLast();
58
}
QgsMapToolShapeAbstract::mPoints
QgsPointSequence mPoints
points (in map coordinates)
Definition
qgsmaptoolshapeabstract.h:113
QgsMapToolShapeAbstract::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *e)
Filters a key release event Ignores the event in default implementation.
Definition
qgsmaptoolshapeabstract.cpp:36
QgsMapToolShapeAbstract::undo
virtual void undo()
Called to undo last action (last point added).
Definition
qgsmaptoolshapeabstract.cpp:52
QgsMapToolShapeAbstract::clean
virtual void clean()
Called to clean the map tool (after canceling the operation or when the digitization has finished).
Definition
qgsmaptoolshapeabstract.cpp:41
QgsMapToolShapeAbstract::keyPressEvent
virtual void keyPressEvent(QKeyEvent *e)
Filters a key press event Ignores the event in default implementation.
Definition
qgsmaptoolshapeabstract.cpp:31
QgsMapToolShapeAbstract::mTempRubberBand
QgsGeometryRubberBand * mTempRubberBand
Definition
qgsmaptoolshapeabstract.h:115
QgsMapToolShapeAbstract::~QgsMapToolShapeAbstract
~QgsMapToolShapeAbstract() override
Definition
qgsmaptoolshapeabstract.cpp:26
qgsgeometryrubberband.h
qgsmaptoolshapeabstract.h
Generated on
for QGIS API Documentation by
1.15.0