From 3180ad415d02aa4bbc881f303cdd2505937945f9 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Thu, 11 Dec 2025 15:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E9=87=8A=E7=BB=93=E8=AE=BA=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E8=BF=BD=E5=8A=A0=E5=B1=82=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/TransparentDraggableResult.h | 5 ++++- logPlus/formdraw.cpp | 7 ++++--- logPlus/qmycustomplot.cpp | 3 ++- logPlus/qmycustomplot.h | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/logPlus/TransparentDraggableResult.h b/logPlus/TransparentDraggableResult.h index 1b320e1..cb8e3e6 100644 --- a/logPlus/TransparentDraggableResult.h +++ b/logPlus/TransparentDraggableResult.h @@ -168,8 +168,11 @@ public: //mItemTitle->position->setCoords(0.5, 0.5); // 设置父锚点,定位点 //mItemTitle->position->setParentAnchor(mRect->bottom); + //mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, + // (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, - (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + lY2 + lY2/2); //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 29cf76d..c1021ba 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -1577,7 +1577,7 @@ bool FormDraw::LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QSt float m_MDepth8; float m_MDepth9; float m_MDepth10; - QString Zone; + QString strZone = QString::number(atoi(m_Result->Zone)); QString Description1; QString Description2; QString Description3; @@ -1709,10 +1709,11 @@ bool FormDraw::LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QSt { if(m_Result->MDepth1!=0) { - widget->addResultToPlot(-m_Result->MDepth1, -m_Result->StartDepth, result, strUuid); + //第一个加Zone解释层号 + widget->addResultToPlot(-m_Result->MDepth1, -m_Result->StartDepth, result, strUuid, strZone); } else { - widget->addResultToPlot(-m_Result->EndDepth, -m_Result->StartDepth, result, strUuid); + widget->addResultToPlot(-m_Result->EndDepth, -m_Result->StartDepth, result, strUuid, strZone); } } diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 84c411d..5b36b45 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -265,7 +265,7 @@ void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QSt m_mapDraggableRect[strUuid] = dragRect; } -void QMyCustomPlot::addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid) +void QMyCustomPlot::addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText) { //获取上方Rect TransparentDraggableResult *upDragRect = nullptr; @@ -287,6 +287,7 @@ void QMyCustomPlot::addResultToPlot(double left_Low, double right_Hight, QStrin //最小宽度 dragRect->setMinWidth(0.1); dragRect->setResult(myResult); + dragRect->setTitle(strText); m_mapDraggable_Result[strUuid] = dragRect; } diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 2afaced..0dccb53 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -73,7 +73,7 @@ public: void addTextToPlot(double left_Low, double right_Hight, const QString strText); - void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid); + void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText=""); public slots: void s_LineClicked(int index);