From d9054d26e6ab5cdd5737a18925b617bafee34cc0 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 18 May 2026 18:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=8C=E5=87=BB=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=9B=BA=E4=BA=95=E3=80=81=E5=9C=B0=E8=B4=A8=E5=B1=82?= =?UTF-8?q?=E4=BD=8D=E9=81=93=E3=80=81=E6=9B=B2=E7=BA=BF=E3=80=81=E5=BD=95?= =?UTF-8?q?=E4=BA=95=E5=89=96=E9=9D=A2=E3=80=81=E5=B2=A9=E6=80=A7=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=96=87=E5=AD=97=E7=BB=93=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/TransparentDraggableGeoLith.cpp | 14 ++ logPlus/TransparentDraggableGeoLith.h | 1 + logPlus/TransparentDraggableGujing.cpp | 14 ++ logPlus/TransparentDraggableGujing.h | 3 +- logPlus/TransparentDraggableLayer.cpp | 14 ++ logPlus/TransparentDraggableLayer.h | 1 + logPlus/TransparentDraggableRect.cpp | 14 ++ logPlus/TransparentDraggableRect.h | 1 + logPlus/qmycustomplot.cpp | 264 +++++++++++++++++++++--- logPlus/qmycustomplot.h | 8 +- 10 files changed, 298 insertions(+), 36 deletions(-) diff --git a/logPlus/TransparentDraggableGeoLith.cpp b/logPlus/TransparentDraggableGeoLith.cpp index 62a965a..e270a86 100644 --- a/logPlus/TransparentDraggableGeoLith.cpp +++ b/logPlus/TransparentDraggableGeoLith.cpp @@ -830,6 +830,10 @@ int TransparentDraggableGeoLith::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -847,6 +851,16 @@ void TransparentDraggableGeoLith::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableGeoLith.h b/logPlus/TransparentDraggableGeoLith.h index 71a1150..502ce79 100644 --- a/logPlus/TransparentDraggableGeoLith.h +++ b/logPlus/TransparentDraggableGeoLith.h @@ -111,6 +111,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableGujing.cpp b/logPlus/TransparentDraggableGujing.cpp index 0a7a17d..d636c8e 100644 --- a/logPlus/TransparentDraggableGujing.cpp +++ b/logPlus/TransparentDraggableGujing.cpp @@ -513,6 +513,10 @@ int TransparentDraggableGujing::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -530,6 +534,16 @@ void TransparentDraggableGujing::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableGujing.h b/logPlus/TransparentDraggableGujing.h index 0870a0e..55fdbc4 100644 --- a/logPlus/TransparentDraggableGujing.h +++ b/logPlus/TransparentDraggableGujing.h @@ -90,7 +90,8 @@ public: //鼠标形状 bool m_bArrow = false; - bool m_bMoveRect = false; + bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableLayer.cpp b/logPlus/TransparentDraggableLayer.cpp index 3e43e43..a85252e 100644 --- a/logPlus/TransparentDraggableLayer.cpp +++ b/logPlus/TransparentDraggableLayer.cpp @@ -445,6 +445,10 @@ int TransparentDraggableLayer::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -462,6 +466,16 @@ void TransparentDraggableLayer::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableLayer.h b/logPlus/TransparentDraggableLayer.h index 28451c7..2f3ed75 100644 --- a/logPlus/TransparentDraggableLayer.h +++ b/logPlus/TransparentDraggableLayer.h @@ -104,6 +104,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableRect.cpp b/logPlus/TransparentDraggableRect.cpp index 9a6a185..e3a4353 100644 --- a/logPlus/TransparentDraggableRect.cpp +++ b/logPlus/TransparentDraggableRect.cpp @@ -333,6 +333,10 @@ int TransparentDraggableRect::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -350,6 +354,16 @@ void TransparentDraggableRect::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableRect.h b/logPlus/TransparentDraggableRect.h index b9f7bdd..e6a5ea3 100644 --- a/logPlus/TransparentDraggableRect.h +++ b/logPlus/TransparentDraggableRect.h @@ -96,6 +96,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 2de9714..9afcb16 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1311,6 +1311,44 @@ void QMyCustomPlot::mouseDoubleClickEvent(QMouseEvent *event) // 在这里添加你的双击处理逻辑 m_bEditor = true; + //曲线 + if(m_addRandomGraph && m_strLineName != "CORE_PHYSICS") + { + //双击编辑曲线 + onEditLine(); + } + else if (m_strLineName == "GEO_LITH") + { + //录井剖面 + onEditGeoLith(); + } + else if (m_strLineName == "WORDS_RELUST") + { + //岩性描述,文字结论 + onEditText(); + } + else if (m_strLineName == "LAYER_DATA") + { + //地质分层 + onEditLayer(); + } + + //------------ + if(m_strType == "") + { + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; + } + if (m_strType == "gujingObject") + { + //双击编辑固井 + onEditGujing(); + } + // 接受事件 event->accept(); } @@ -1450,7 +1488,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) QCustomPlot::mouseMoveEvent(event); - int nmaxCursor = 0; + int nmaxCursor = -1; //解释结论 QObjectList objList = m_mapDragGroup.values(); for( int i = 0; i< objList.size(); i++) @@ -1577,7 +1615,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) { this->setCursor(Qt::SizeVerCursor); } - else + else if (nmaxCursor == 3) { QCursor currentCursor = this->cursor(); if(currentCursor == Qt::CrossCursor) @@ -1588,6 +1626,63 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) this->setCursor(Qt::ArrowCursor); } } + else + { + bool bCheck = false; + //曲线 + /*if(m_addRandomGraph && m_strLineName != "CORE_PHYSICS") + { + bCheck = true; + } + else */if (m_strLineName == "GEO_LITH") + { + //录井剖面 + bCheck = true; + } + else if (m_strLineName == "WORDS_RELUST") + { + //岩性描述,文字结论 + bCheck = true; + } + else if (m_strLineName == "LAYER_DATA") + { + //地质分层 + bCheck = true; + } + + // + if(m_strType == "") + { + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; + } + + // + if (m_strType == "gujingObject") + { + bCheck = true; + } + if(bCheck) + { + //十字标,编辑 + if(m_bEditRect) + { + this->setCursor(Qt::CrossCursor); + } + else + { + this->setCursor(Qt::ArrowCursor); + } + } + else + { + this->setCursor(Qt::ArrowCursor); + } + } // if (mMousePress) { // auto items = selectedItems(); @@ -1792,6 +1887,7 @@ void QMyCustomPlot::s_LineClicked(int index) // } } +//右键 void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { m_event = event; @@ -1802,7 +1898,13 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/ZonePoint.png"), "添加分段线", this, &QMyCustomPlot::onAddShiftLine); menu.addAction(QIcon(::GetImagePath() + "icon/ClearZonePoint.png"), "清除当前分段线", this, &QMyCustomPlot::onDelSelectShiftLine); menu.addAction(QIcon(::GetImagePath() + "icon/ClearZone.png"), "清除全部分段线", this, &QMyCustomPlot::onDelAllShiftLine); - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑曲线", this, &QMyCustomPlot::onEditLine); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑曲线", this, &QMyCustomPlot::onCloseEditLine); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑曲线", this, &QMyCustomPlot::onEditLine); + } menu.exec(event->globalPos()); } @@ -1822,8 +1924,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //录井剖面 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑录井剖面", this, &QMyCustomPlot::onEditGeoLith); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑录井剖面", this, &QMyCustomPlot::onCloseEditGeoLith); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑录井剖面", this, &QMyCustomPlot::onEditGeoLith); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_GeoLith); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_GeoLith); @@ -1833,8 +1941,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //岩性描述,文字结论 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑文字结论", this, &QMyCustomPlot::onEditText); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Text); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑文字结论", this, &QMyCustomPlot::onCloseEditText); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑文字结论", this, &QMyCustomPlot::onEditText); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Text); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Text); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Text); @@ -1844,8 +1958,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //地质分层 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑地质分层", this, &QMyCustomPlot::onEditLayer); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Layer); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑地质分层", this, &QMyCustomPlot::onCloseEditLayer); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑地质分层", this, &QMyCustomPlot::onEditLayer); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); @@ -1915,13 +2035,16 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) } // - FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); - if (pInfo == NULL) + if(m_strType == "") { - return; + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; } - QString strType = pInfo->m_strType; - if (strType == "JiegutextObject") + if (m_strType == "JiegutextObject") { QMenu menu(this); //气测/FMT/射孔/文本 @@ -1931,11 +2054,17 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Jiegutext); menu.exec(event->globalPos()); } - else if (strType == "gujingObject") + else if (m_strType == "gujingObject") { QMenu menu(this); //固井 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑固井结论", this, &QMyCustomPlot::onEditGujing); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑固井结论", this, &QMyCustomPlot::onCloseEditGujing); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑固井结论", this, &QMyCustomPlot::onEditGujing); + } menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Gujing); @@ -1943,7 +2072,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing); menu.exec(event->globalPos()); } - else if (strType == "LogfaceObject") + else if (m_strType == "LogfaceObject") { QMenu menu(this); //沉积相 @@ -1951,7 +2080,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) //menu.addAction(QIcon(::GetImagePath() + "icon/Layer.png"), "沉积相自动描述", this, &QMyCustomPlot::ChangeDep); menu.exec(event->globalPos()); } - else if (strType == "TubingstringObject") + else if (m_strType == "TubingstringObject") { QStringList strs=zoneOrder_Tubing.keys(); QStringList mstrs=QString("油管接箍,套管接箍,偏配,封隔器,筛管,喇叭口,水力猫,短接,管底部,油管深").split(","); @@ -1976,7 +2105,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.exec(event->globalPos()); } - else if (strType == "CrackObject") // 裂缝 + else if (m_strType == "CrackObject") // 裂缝 { QMenu menu(this); menu.addAction(QIcon(::GetImagePath() + "curve.png"), "添加裂缝", this, &QMyCustomPlot::addCrackObject); @@ -2019,6 +2148,9 @@ void QMyCustomPlot::onEditLine() } this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + //this->setCursor(Qt::CrossCursor); + + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { @@ -2039,7 +2171,6 @@ void QMyCustomPlot::onEditLine() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2073,7 +2204,7 @@ void QMyCustomPlot::onEditLine() } } - if(abs(right_Hight-left_Low) >= (3*rlev) )//至少选中5个点 + if(abs(right_Hight-left_Low) >= (3*rlev) && abs(right_Hight_Number-left_Low_Number)>0)//至少选中5个点 { // for (int j=right_Hight_Number; j::Iterator it = this->m_mapDraggable_SelectRect.begin(); + if( it != this->m_mapDraggable_SelectRect.end() ) + { + pDraggableRect = (TransparentDraggableSelectRect*)it.value(); + pDraggableRect->deleteRect(); + } + } + replot(); + + m_bEditRect = false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + //右键--添加文字结论 void QMyCustomPlot::onEditText() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2124,7 +2279,6 @@ void QMyCustomPlot::onEditText() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2171,20 +2325,30 @@ void QMyCustomPlot::onEditText() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑文字结论 +void QMyCustomPlot::onCloseEditText() +{ + m_bEditRect = false; + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} //右键--添加地质分层 void QMyCustomPlot::onEditLayer() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2204,7 +2368,6 @@ void QMyCustomPlot::onEditLayer() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2260,11 +2423,24 @@ void QMyCustomPlot::onEditLayer() } } +//右键--关闭编辑地质分层 +void QMyCustomPlot::onCloseEditLayer() +{ + m_bEditRect=false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + //右键--添加固井 void QMyCustomPlot::onEditGujing() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { @@ -2285,7 +2461,6 @@ void QMyCustomPlot::onEditGujing() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2332,14 +2507,24 @@ void QMyCustomPlot::onEditGujing() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑固井 +void QMyCustomPlot::onCloseEditGujing() +{ + m_bEditRect = false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + // 岩心图片 void QMyCustomPlot::onEditImage() { @@ -2829,7 +3014,9 @@ void QMyCustomPlot::onEditGeoLith() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2849,7 +3036,6 @@ void QMyCustomPlot::onEditGeoLith() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2977,14 +3163,24 @@ void QMyCustomPlot::onEditGeoLith() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑录井剖面 +void QMyCustomPlot::onCloseEditGeoLith() +{ + m_bEditRect=false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + bool QMyCustomPlot::SaveToSLF_SwallCore() { static int isrun=false; diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 340c222..b42f7d6 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -559,12 +559,14 @@ public slots: //右键--编辑曲线 void onEditLine(); + void onCloseEditLine(); //通用 void ClearSelectItems(); //取消选中 //右键--编辑固井 void onEditGujing(); + void onCloseEditGujing(); void addItems_Gujing(); //从剪切板文本数据粘贴 void DeleteItems_Gujing(); //全部清空 void RefreshItems_Gujing(); //刷新数据 @@ -597,7 +599,8 @@ public slots: void AddItem_SWallCore(QStringList lists); //右键--编辑录井剖面 - void onEditGeoLith(); + void onEditGeoLith(); + void onCloseEditGeoLith(); void addItems_GeoLith(); //从剪切板文本数据粘贴 void DeleteItems_GeoLith(); //全部清空 void RefreshItems_GeoLith(); //刷新数据 @@ -605,6 +608,7 @@ public slots: //右键--编辑文字结论 void onEditText(); + void onCloseEditText(); void addItems_Text(); //从剪切板文本数据粘贴 void DeleteItems_Text(); //全部清空 void RefreshItems_Text(); //刷新数据 @@ -612,6 +616,7 @@ public slots: //右键--编辑地质分层 void onEditLayer(); + void onCloseEditLayer(); void addItems_Layer(); //从剪切板文本数据粘贴 void DeleteItems_Layer(); //全部清空 void RefreshItems_Layer(); //刷新数据 @@ -748,6 +753,7 @@ public: //单点移动功能 void executeSingle(QMouseEvent *event); + //右键 virtual void contextMenuEvent(QContextMenuEvent *event); QList m_FracTabList;