QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
maptools
qgsmaptoolselect.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaptoolselect.h - map tool for selecting features
3
---------------------
4
begin : May 2010
5
copyright : (C) 2010 by Jeremy Palmer
6
email : jpalmer at linz dot govt dot nz
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 QGSMAPTOOLSELECT_H
17
#define QGSMAPTOOLSELECT_H
18
19
#include "
qgsmaptool.h
"
20
#include "
qgsmaptoolselectionhandler.h
"
21
22
#define SIP_NO_FILE
23
24
// no bindings for now, not stable yet. Previously lived in src/app
25
26
class
QgsMapCanvas
;
27
class
QgsHighlight
;
28
29
class
QMouseEvent;
30
38
class
GUI_EXPORT
QgsMapToolSelect
:
public
QgsMapTool
39
{
40
Q_OBJECT
41
public
:
43
enum
Mode
44
{
45
GeometryIntersectsSetSelection
,
46
GeometryIntersectsAddToSelection
,
47
GeometryIntersectsSubtractFromSelection
,
48
GeometryIntersectsIntersectWithSelection
,
49
GeometryWithinSetSelection
,
50
GeometryWithinAddToSelection
,
51
GeometryWithinSubtractFromSelection
,
52
GeometryWithinIntersectWithSelection
,
53
};
54
55
QgsMapToolSelect
(
QgsMapCanvas
*canvas );
56
58
void
setSelectionMode(
QgsMapToolSelectionHandler::SelectionMode
selectionMode );
59
60
void
canvasPressEvent
(
QgsMapMouseEvent
*e )
override
;
61
void
canvasMoveEvent
(
QgsMapMouseEvent
*e )
override
;
62
void
canvasReleaseEvent
(
QgsMapMouseEvent
*e )
override
;
63
void
keyPressEvent
( QKeyEvent *e )
override
;
64
void
keyReleaseEvent
( QKeyEvent *e )
override
;
65
void
deactivate
()
override
;
66
Flags
flags
()
const override
;
67
68
bool
populateContextMenuWithEvent
( QMenu *menu,
QgsMapMouseEvent
*event )
override
;
69
70
signals:
72
void
modeChanged
(
QgsMapToolSelect::Mode
mode );
73
74
private
slots:
75
void
selectFeatures( Qt::KeyboardModifiers modifiers );
76
77
private
:
78
std::unique_ptr<QgsMapToolSelectionHandler> mSelectionHandler;
79
80
void
modifiersChanged(
bool
ctrlModifier,
bool
shiftModifier,
bool
altModifier );
81
};
82
83
#endif
QgsHighlight
Highlights features on the map.
Definition
qgshighlight.h:63
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapMouseEvent
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Definition
qgsmapmouseevent.h:38
QgsMapToolSelect
A map tool for selecting features on a map canvas.
Definition
qgsmaptoolselect.h:39
QgsMapToolSelect::modeChanged
void modeChanged(QgsMapToolSelect::Mode mode)
Emitted when the selection mode changes, usually when qt modifiers are changed.
QgsMapToolSelect::Mode
Mode
Define selection modes used by the different combinations of modifiers.
Definition
qgsmaptoolselect.h:44
QgsMapToolSelect::GeometryWithinSubtractFromSelection
@ GeometryWithinSubtractFromSelection
Definition
qgsmaptoolselect.h:51
QgsMapToolSelect::GeometryWithinIntersectWithSelection
@ GeometryWithinIntersectWithSelection
Definition
qgsmaptoolselect.h:52
QgsMapToolSelect::GeometryWithinAddToSelection
@ GeometryWithinAddToSelection
Definition
qgsmaptoolselect.h:50
QgsMapToolSelect::GeometryIntersectsSubtractFromSelection
@ GeometryIntersectsSubtractFromSelection
Definition
qgsmaptoolselect.h:47
QgsMapToolSelect::GeometryIntersectsAddToSelection
@ GeometryIntersectsAddToSelection
Definition
qgsmaptoolselect.h:46
QgsMapToolSelect::GeometryWithinSetSelection
@ GeometryWithinSetSelection
Definition
qgsmaptoolselect.h:49
QgsMapToolSelect::GeometryIntersectsIntersectWithSelection
@ GeometryIntersectsIntersectWithSelection
Definition
qgsmaptoolselect.h:48
QgsMapToolSelect::GeometryIntersectsSetSelection
@ GeometryIntersectsSetSelection
Definition
qgsmaptoolselect.h:45
QgsMapToolSelectionHandler::SelectionMode
SelectionMode
Select features to identify by:
Definition
qgsmaptoolselectionhandler.h:92
QgsMapTool::QgsMapTool
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
Definition
qgsmaptool.cpp:39
QgsMapTool::populateContextMenuWithEvent
virtual bool populateContextMenuWithEvent(QMenu *menu, QgsMapMouseEvent *event)
Allows the tool to populate and customize the given menu, prior to showing it in response to a right-...
Definition
qgsmaptool.cpp:273
QgsMapTool::canvasPressEvent
virtual void canvasPressEvent(QgsMapMouseEvent *e)
Mouse press event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:193
QgsMapTool::canvasMoveEvent
virtual void canvasMoveEvent(QgsMapMouseEvent *e)
Mouse move event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:183
QgsMapTool::keyPressEvent
virtual void keyPressEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:208
QgsMapTool::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:213
QgsMapTool::flags
virtual Flags flags() const
Returns the flags for the map tool.
Definition
qgsmaptool.h:122
QgsMapTool::canvasReleaseEvent
virtual void canvasReleaseEvent(QgsMapMouseEvent *e)
Mouse release event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:198
QgsMapTool::deactivate
virtual void deactivate()
called when map tool is being deactivated
Definition
qgsmaptool.cpp:121
QgsMapToolSelect::QgsMapToolSelect
QgsMapToolSelect(QgsMapCanvas *canvas)
A map tool for selecting features on a map canvas.
Definition
qgsmaptoolselect.cpp:39
qgsmaptool.h
qgsmaptoolselectionhandler.h
Generated on
for QGIS API Documentation by
1.17.0