Skip to content

Commit 1ccf970

Browse files
committed
Add a companion signal for when tools are removed.
1 parent 6071481 commit 1ccf970

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Plugin/CppApi/include/ToolManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class TOOLKIT_EXPORT ToolManager : public QObject
6565

6666
signals:
6767
void toolAdded(Esri::ArcGISRuntime::Toolkit::AbstractTool* tool);
68+
void toolRemoved(const QString& toolName);
6869

6970
private:
7071
ToolManager();

Plugin/CppApi/source/ToolManager.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ void ToolManager::removeTool(AbstractTool* tool)
9191
{
9292
if (it.value() == tool)
9393
{
94+
emit toolRemoved(it.key());
9495
m_tools.erase(it);
9596
return;
9697
}
@@ -145,6 +146,28 @@ ToolManager::ToolsList::const_iterator ToolManager::end() const
145146
return m_tools.cend();
146147
}
147148

149+
/*!
150+
\fn void ToolManager::toolAdded(Esri::ArcGISRuntime::Toolkit::AbstractTool* tool);
151+
\brief The signal emitted when a tool has been added to the ToolManager.
152+
153+
\list
154+
\li \a tool - The tool that was added.
155+
\endlist
156+
*/
157+
158+
/*!
159+
\fn void ToolManager::toolRemoved(const QString& toolName);
160+
\brief The signal emitted when a tool has been removed from the ToolManager.
161+
162+
\list
163+
\li \a toolName - The name of the tool that was removed.
164+
\endlist
165+
166+
The name of the tool is provided instead of a pointer to the tool
167+
like with \l toolAdded. This is for safety since the pointer may
168+
be invalid when the tool has been removed.
169+
*/
170+
148171
} // Toolkit
149172
} // ArcGISRuntime
150173
} // Esri

0 commit comments

Comments
 (0)