/
qgsmaptoolidentifyaction.h
87 lines (66 loc) · 2.8 KB
/
qgsmaptoolidentifyaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/***************************************************************************
qgsmaptoolidentify.h - map tool for identifying features
---------------------
begin : January 2006
copyright : (C) 2006 by Martin Dobias
email : wonder.sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSMAPTOOLIDENTIFYACTION_H
#define QGSMAPTOOLIDENTIFYACTION_H
#include "qgis.h"
#include "qgsmaptoolidentify.h"
#include "qgspoint.h"
#include "qgsfeature.h"
#include "qgsfeaturestore.h"
#include "qgsfield.h"
#include "qgsdistancearea.h"
#include <QObject>
#include <QPointer>
class QgsIdentifyResultsDialog;
class QgsMapLayer;
class QgsRasterLayer;
class QgsVectorLayer;
/**
\brief Map tool for identifying features layers and showing results
after selecting a point shows dialog with identification results
- for raster layers shows value of underlying pixel
- for vector layers shows feature attributes within search radius
(allows editing values when vector layer is in editing mode)
*/
class APP_EXPORT QgsMapToolIdentifyAction : public QgsMapToolIdentify
{
Q_OBJECT
public:
QgsMapToolIdentifyAction( QgsMapCanvas * canvas );
~QgsMapToolIdentifyAction();
//! Overridden mouse move event
virtual void canvasMoveEvent( QgsMapMouseEvent* e ) override;
//! Overridden mouse press event
virtual void canvasPressEvent( QgsMapMouseEvent* e ) override;
//! Overridden mouse release event
virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
virtual void activate() override;
virtual void deactivate() override;
public slots:
void handleCopyToClipboard( QgsFeatureStore & );
void handleChangedRasterResults( QList<IdentifyResult>& results );
signals:
void identifyProgress( int, int );
void identifyMessage( const QString& );
void copyToClipboard( QgsFeatureStore & );
private slots:
void showAttributeTable( QgsMapLayer* layer, const QList<QgsFeature>& featureList );
private:
//! Pointer to the identify results dialog for name/value pairs
QPointer<QgsIdentifyResultsDialog> mResultsDialog;
QgsIdentifyResultsDialog *resultsDialog();
virtual QGis::UnitType displayUnits() override;
};
#endif