File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1414# limitations under the License.
1515# ###############################################################################
1616
17- # this is identical to the included project except it produces a statib library
17+ # this is identical to the included project except it produces a static library
1818# rather than a dynamic library
1919
2020CONFIG += staticlib
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ namespace Toolkit
3232
3333class AbstractTool ;
3434
35- class TOOLKIT_EXPORT ToolManager {
35+ class TOOLKIT_EXPORT ToolManager : public QObject
36+ {
37+ Q_OBJECT
3638
3739 using ToolsList = QMap<QString, AbstractTool*>;
3840
@@ -61,6 +63,10 @@ class TOOLKIT_EXPORT ToolManager {
6163 ToolsList::const_iterator begin () const ;
6264 ToolsList::const_iterator end () const ;
6365
66+ signals:
67+ void toolAdded (Esri::ArcGISRuntime::Toolkit::AbstractTool* tool);
68+ void toolRemoved (const QString& toolName);
69+
6470private:
6571 ToolManager ();
6672
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ void ToolManager::addTool(AbstractTool* tool)
6868 });
6969
7070 m_tools.insert (tool->toolName (), tool);
71+ emit toolAdded (tool);
7172}
7273
7374/* ! \brief Removes the \l AbstractTool called \a toolName from the manager.
@@ -90,6 +91,7 @@ void ToolManager::removeTool(AbstractTool* tool)
9091 {
9192 if (it.value () == tool)
9293 {
94+ emit toolRemoved (it.key ());
9395 m_tools.erase (it);
9496 return ;
9597 }
@@ -144,6 +146,28 @@ ToolManager::ToolsList::const_iterator ToolManager::end() const
144146 return m_tools.cend ();
145147}
146148
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+
147171} // Toolkit
148172} // ArcGISRuntime
149173} // Esri
You can’t perform that action at this time.
0 commit comments