QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsmaptoolidentifyfeature.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaptoolidentifyfeature.h
3  --------------------------------------
4  Date : 22.5.2014
5  Copyright : (C) 2014 Denis Rouzaud
6  Email : [email protected]
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 QGSMAPTOOLIDENTIFYFEATURE_H
17 #define QGSMAPTOOLIDENTIFYFEATURE_H
18 
19 #include "qgsmaptoolidentify.h"
20 
27 {
28  Q_OBJECT
29 
30  public:
36  QgsMapToolIdentifyFeature( QgsMapCanvas* canvas, QgsVectorLayer* vl = nullptr );
37 
39 
41  void setLayer( QgsVectorLayer* vl ) { mLayer = vl; }
42 
43  virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
44 
45  signals:
46  void featureIdentified( const QgsFeature& );
47  void featureIdentified( QgsFeatureId );
48 
49  protected:
50  virtual void keyPressEvent( QKeyEvent* e ) override;
51 
52  private:
54  QgsVectorLayer* mLayer;
55 };
56 
57 #endif // QGSMAPTOOLIDENTIFYFEATURE_H
void setLayer(QgsVectorLayer *vl)
change the layer used by the map tool to identify
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
virtual void canvasReleaseEvent(QgsMapMouseEvent *e) override
Overridden mouse release event.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
QgsMapCanvas * mCanvas
pointer to map canvas
Definition: qgsmaptool.h:213
Map tool for identifying features in layers.
virtual void keyPressEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:170
The QgsMapToolIdentifyFeature class is a map tool to identify a feature on a chosen layer...
qint64 QgsFeatureId
Definition: qgsfeature.h:31
Represents a vector layer which manages a vector based data sets.