diff --git a/Include/nmNum/nmPlot/nmGuiPlotCmdHelper.h b/Include/nmNum/nmPlot/nmGuiPlotCmdHelper.h index 9d7a8a0c..7d71f611 100644 --- a/Include/nmNum/nmPlot/nmGuiPlotCmdHelper.h +++ b/Include/nmNum/nmPlot/nmGuiPlotCmdHelper.h @@ -21,6 +21,9 @@ public: virtual bool runAction(QString sAction) override; + // 允许重复点击选择按钮,以退出当前地图工具。 + virtual void fuzzyCheckStates(QAction* pAction, bool& bRepeatedHit) override; + // 取消当前地图绘图操作,并恢复默认操作状态. void cancelActiveTools(); diff --git a/Src/nmNum/nmPlot/nmGuiPlotCmdHelper.cpp b/Src/nmNum/nmPlot/nmGuiPlotCmdHelper.cpp index 4e78da2e..5127c6c8 100644 --- a/Src/nmNum/nmPlot/nmGuiPlotCmdHelper.cpp +++ b/Src/nmNum/nmPlot/nmGuiPlotCmdHelper.cpp @@ -1,5 +1,6 @@ #include "ZxBaseUtil.h" #include "zxLogInstance.h" +#include #include #include #include @@ -68,6 +69,16 @@ nmGuiPlotCmdHelper::nmGuiPlotCmdHelper(iGuiPlot* p) nmGuiPlotCmdHelper::~nmGuiPlotCmdHelper() { } +void nmGuiPlotCmdHelper::fuzzyCheckStates(QAction* pAction, bool& bRepeatedHit) +{ + iGuiPlotCmdHelper::fuzzyCheckStates(pAction, bRepeatedHit); + if (pAction != nullptr && pAction->objectName() == QLatin1String("Select")) { + // 测量等工具启动后,选择按钮可能仍处于选中状态。 + bRepeatedHit = false; + pAction->setChecked(true); + } +} + bool nmGuiPlotCmdHelper::runAction(QString sAction) { Q_ASSERT (NULL != m_pGuiPlot); ZxPlot* pPlot = m_pGuiPlot->m_pPlot;