/
qgsmapcanvastracer.h
47 lines (33 loc) · 1.19 KB
/
qgsmapcanvastracer.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
#ifndef QGSMAPCANVASTRACER_H
#define QGSMAPCANVASTRACER_H
#include "qgsmessagebar.h"
#include "qgstracer.h"
class QAction;
class QgsMapCanvas;
class GUI_EXPORT QgsMapCanvasTracer : public QgsTracer
{
Q_OBJECT
public:
explicit QgsMapCanvasTracer( QgsMapCanvas* canvas );
~QgsMapCanvasTracer();
QAction* actionEnableTracing() { return mActionEnableTracing; }
virtual bool init();
//! Retrieve instance of this class associated with given canvas (if any).
//! The class keeps a simple registry of tracers associated with map canvas
//! instances for easier access to the common tracer by various map tools
static QgsMapCanvasTracer* tracerForCanvas( QgsMapCanvas* canvas );
signals:
//! emit a message
void messageEmitted( const QString& message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );
//! emit signal to clear previous message
//void messageDiscarded();
private slots:
void updateSettings();
void updateLayerSettings();
void onCurrentLayerChanged();
private:
QgsMapCanvas* mCanvas;
QAction* mActionEnableTracing;
static QHash<QgsMapCanvas*, QgsMapCanvasTracer*> sTracers;
};
#endif // QGSMAPCANVASTRACER_H