QGIS API Documentation 4.1.0-Master (4aad578bf8d)
Loading...
Searching...
No Matches
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"
21
22#define SIP_NO_FILE
23
24// no bindings for now, not stable yet. Previously lived in src/app
25
26class QgsMapCanvas;
27class QgsHighlight;
28
29class QMouseEvent;
30
38class GUI_EXPORT QgsMapToolSelect : public QgsMapTool
39{
40 Q_OBJECT
41 public:
54
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:
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
Highlights features on the map.
Map canvas is a class for displaying all GIS data types on a canvas.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
A map tool for selecting features on a map canvas.
void modeChanged(QgsMapToolSelect::Mode mode)
Emitted when the selection mode changes, usually when qt modifiers are changed.
Mode
Define selection modes used by the different combinations of modifiers.
@ GeometryIntersectsSubtractFromSelection
@ GeometryIntersectsIntersectWithSelection
SelectionMode
Select features to identify by:
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
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-...
virtual void canvasPressEvent(QgsMapMouseEvent *e)
Mouse press event for overriding. Default implementation does nothing.
virtual void canvasMoveEvent(QgsMapMouseEvent *e)
Mouse move event for overriding. Default implementation does nothing.
virtual void keyPressEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
virtual void keyReleaseEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
virtual Flags flags() const
Returns the flags for the map tool.
Definition qgsmaptool.h:122
virtual void canvasReleaseEvent(QgsMapMouseEvent *e)
Mouse release event for overriding. Default implementation does nothing.
virtual void deactivate()
called when map tool is being deactivated
QgsMapToolSelect(QgsMapCanvas *canvas)
A map tool for selecting features on a map canvas.