From d726b54ce9ff682cefa0093f6f24fc7e3c032ad4 Mon Sep 17 00:00:00 2001 From: kradchen Date: Mon, 7 Jul 2025 10:14:48 +0800 Subject: [PATCH] fix: fix a wheel enable bug when measuring --- src/src/Common/QGlobals.cpp | 1 + src/src/Common/QGlobals.h | 2 +- src/src/Rendering/Measure/Measure.cpp | 9 +++++++++ src/src/Rendering/Measure/Measure.h | 7 +------ src/src/UI/Widget/ImageView/dicomimageview.cpp | 1 + 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/src/Common/QGlobals.cpp b/src/src/Common/QGlobals.cpp index cf94f84..dd8b61b 100644 --- a/src/src/Common/QGlobals.cpp +++ b/src/src/Common/QGlobals.cpp @@ -12,6 +12,7 @@ int FontSizeHelper::desktop_width = 1080; bool AnnoHelper::privacyOn = false; bool AnnoHelper::annotOn = true; +bool MeasureHelper::measuring = false; int MeasureHelper::measureType = 0; diff --git a/src/src/Common/QGlobals.h b/src/src/Common/QGlobals.h index 75701b7..bd16817 100644 --- a/src/src/Common/QGlobals.h +++ b/src/src/Common/QGlobals.h @@ -210,7 +210,7 @@ class MeasureHelper { public: - static bool measureOn; + static bool measuring; static int getMeasureType(){ return measureType; } diff --git a/src/src/Rendering/Measure/Measure.cpp b/src/src/Rendering/Measure/Measure.cpp index c16c5b6..0454df4 100644 --- a/src/src/Rendering/Measure/Measure.cpp +++ b/src/src/Rendering/Measure/Measure.cpp @@ -1,5 +1,14 @@ #include "Measure.h" +#include "Common/QGlobals.h" bool Measure::Hidden = false; +void Measure::SetPlacing(bool p) + { + if (Hidden) { + Hidden = false; + } + this->Placing = p; + MeasureHelper::measuring = Placing; +} diff --git a/src/src/Rendering/Measure/Measure.h b/src/src/Rendering/Measure/Measure.h index dd32d0a..7227c32 100644 --- a/src/src/Rendering/Measure/Measure.h +++ b/src/src/Rendering/Measure/Measure.h @@ -39,12 +39,7 @@ public: return this->Placing; } - void SetPlacing(bool p) { - if (Hidden) { - Hidden = false; - } - this->Placing = p; - } + void SetPlacing(bool p); void SetMeasureID(const QString &Id) { id = Id; diff --git a/src/src/UI/Widget/ImageView/dicomimageview.cpp b/src/src/UI/Widget/ImageView/dicomimageview.cpp index b61f8d7..2e45b5f 100644 --- a/src/src/UI/Widget/ImageView/dicomimageview.cpp +++ b/src/src/UI/Widget/ImageView/dicomimageview.cpp @@ -274,6 +274,7 @@ void DicomImageView::clicked() { //Widget event---------------------------------------------------------------- void DicomImageView::wheelEvent(QWheelEvent *event) { if (hasSeries()) { + if (MeasureHelper::measuring) return; int _Slice = mImageViewer->GetSlice(); int _MinSlice = mImageViewer->GetSliceMin(); int _MaxSlice = mImageViewer->GetSliceMax();