diff --git a/python/gui/qgsmaptoolcapture.sip b/python/gui/qgsmaptoolcapture.sip index 33200bf13dfa..e6c600197026 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 a94939fd41a3..a258bf904162 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 31e012f74654..6c27daddcadd 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;