QGIS API Documentation  2.14.0-Essen
qgsmapcanvastracer.h
Go to the documentation of this file.
1 #ifndef QGSMAPCANVASTRACER_H
2 #define QGSMAPCANVASTRACER_H
3 
4 #include "qgstracer.h"
5 
6 class QAction;
7 class QgsMapCanvas;
8 class QgsMessageBar;
10 
24 class GUI_EXPORT QgsMapCanvasTracer : public QgsTracer
25 {
26  Q_OBJECT
27 
28  public:
30  explicit QgsMapCanvasTracer( QgsMapCanvas* canvas, QgsMessageBar* messageBar = 0 );
32 
34  QAction* actionEnableTracing() const { return mActionEnableTracing; }
35 
38  void setActionEnableTracing( QAction* action ) { mActionEnableTracing = action; }
39 
43  static QgsMapCanvasTracer* tracerForCanvas( QgsMapCanvas* canvas );
44 
46  void reportError( PathError err, bool addingVertex );
47 
48  protected:
50  virtual void configure();
51 
52  private slots:
53  void onCurrentLayerChanged();
54 
55  private:
56  QgsMapCanvas* mCanvas;
57  QgsMessageBar* mMessageBar;
58  QgsMessageBarItem* mLastMessage;
59 
60  QAction* mActionEnableTracing;
61 
63 };
64 
65 #endif // QGSMAPCANVASTRACER_H
virtual void configure()
Allows derived classes to setup the settings just before the tracer is initialized.
Definition: qgstracer.h:101
Utility class that construct a planar graph from the input vector layers and provides shortest path s...
Definition: qgstracer.h:38
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:42
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:105
void setActionEnableTracing(QAction *action)
Assign "enable tracing" checkable action to the tracer.
Extension of QgsTracer that provides extra functionality:
PathError
Possible errors that may happen when calling findShortestPath()
Definition: qgstracer.h:80
QAction * actionEnableTracing() const
Access to action that user may use to toggle tracing on/off. May be null if no action was associated...