Skip to content

Commit 8e5cb7d

Browse files
YoannQDQnyalldawson
authored andcommittedApr 24, 2023
Add reactivated signal
1 parent 9e3d591 commit 8e5cb7d

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed
 

‎python/gui/auto_generated/qgsmaptool.sip.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ signal emitted once the map tool is activated
297297
void deactivated();
298298
%Docstring
299299
signal emitted once the map tool is deactivated
300+
%End
301+
302+
void reactivated();
303+
%Docstring
304+
305+
.. versionadded:: 3.32
300306
%End
301307

302308
protected:

‎src/app/qgsmeasuretool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void QgsMeasureTool::reactivate()
103103
// User clicked on the measure action while it was already active
104104
// Only ensure that the dialog is visible
105105
mDialog->show();
106+
QgsMapTool::reactivate();
106107
}
107108

108109
void QgsMeasureTool::restart()

‎src/gui/qgsmaptool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void QgsMapTool::deactivate()
120120

121121
void QgsMapTool::reactivate()
122122
{
123-
123+
emit reactivated();
124124
}
125125

126126
void QgsMapTool::clean()

‎src/gui/qgsmaptool.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ class GUI_EXPORT QgsMapTool : public QObject
287287
//! signal emitted once the map tool is deactivated
288288
void deactivated();
289289

290+
//! \since QGIS 3.32 signal emitted when the map tool is activated while it is already active
291+
void reactivated();
292+
290293
private slots:
291294
//! clear pointer when action is destroyed
292295
void actionDestroyed();

0 commit comments

Comments
 (0)
Please sign in to comment.