diff --git a/python/gui/qgsmaptoolcapture.sip b/python/gui/qgsmaptoolcapture.sip index 33200bf13df..e6c60019702 100644 --- a/python/gui/qgsmaptoolcapture.sip +++ b/python/gui/qgsmaptoolcapture.sip @@ -25,6 +25,9 @@ class QgsMapToolCapture : public QgsMapToolAdvancedDigitizing //! destructor virtual ~QgsMapToolCapture(); + //! active the tool + virtual void activate(); + //! deactive the tool virtual void deactivate(); diff --git a/src/gui/qgsmaptoolcapture.cpp b/src/gui/qgsmaptoolcapture.cpp index a94939fd41a..a258bf90416 100644 --- a/src/gui/qgsmaptoolcapture.cpp +++ b/src/gui/qgsmaptoolcapture.cpp @@ -75,8 +75,19 @@ QgsMapToolCapture::~QgsMapToolCapture() } } +void QgsMapToolCapture::activate() +{ + if ( mTempRubberBand ) + mTempRubberBand->show(); + + QgsMapToolAdvancedDigitizing::activate(); +} + void QgsMapToolCapture::deactivate() { + if ( mTempRubberBand ) + mTempRubberBand->hide(); + delete mSnappingMarker; mSnappingMarker = nullptr; diff --git a/src/gui/qgsmaptoolcapture.h b/src/gui/qgsmaptoolcapture.h index 31e012f7465..6c27daddcad 100644 --- a/src/gui/qgsmaptoolcapture.h +++ b/src/gui/qgsmaptoolcapture.h @@ -42,6 +42,9 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing //! destructor virtual ~QgsMapToolCapture(); + //! active the tool + virtual void activate() override; + //! deactive the tool virtual void deactivate() override;