From c50a411f86ee955528ee6b0dd84f8cb4d0b9c589 Mon Sep 17 00:00:00 2001 From: lh <2334563547@qq.com> Date: Mon, 23 Nov 2026 10:08:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(nmPlot):=20=E4=BF=AE=E5=A4=8D=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E9=80=89=E6=8B=A9=E6=8C=89=E9=92=AE=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=97=B6=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 选择按钮已处于选中状态时,仍可退出当前绘制或测量工具,回到图元选择模式。 --- Include/nmNum/nmPlot/nmGuiPlotCmdHelper.h | 3 +++ Src/nmNum/nmPlot/nmGuiPlotCmdHelper.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) 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;