From 813cf49acfe69397b06aa5950db183ca931dc36c Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 3 Jun 2026 10:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E4=BA=95=E5=90=8D=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/mainwindowcurve.cpp | 48 ++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 773b944..114fa14 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -6306,13 +6306,21 @@ void MainWindowCurve::slotDeleteSelectWell() } else { - QTableWidgetItem* pItem = ui->tableWidget_2->item(iCurrentRow, column); - if (pItem) - { - QString strWellName = pItem->text(); - m_listWell.removeOne(strWellName); - m_mapFWell.remove(strWellName); - } +// QTableWidgetItem* pItem = ui->tableWidget_2->item(iCurrentRow, column); +// if (pItem) +// { +// QString strWellName = pItem->text(); +// m_listWell.removeOne(strWellName); +// m_mapFWell.remove(strWellName); +// } + + WellHeader* pWheader = qobject_cast(ui->tableWidget_2->cellWidget(iCurrentRow, column)); + if (pWheader) + { + QString strWellName = pWheader->m_strWellName; + m_listWell.removeOne(strWellName); + m_mapFWell.remove(strWellName); + } // ui->tableWidget_2->removeColumn(column+1);//空白列,注意先删除空白列,否则列号改变 ui->tableWidget_2->removeColumn(column); @@ -6320,13 +6328,20 @@ void MainWindowCurve::slotDeleteSelectWell() } else if (column > 1) { - QTableWidgetItem* pItem = ui->tableWidget_2->item(iCurrentRow, column); - if (pItem) - { - QString strWellName = pItem->text(); - m_listWell.removeOne(strWellName); - m_mapFWell.remove(strWellName); - } +// QTableWidgetItem* pItem = ui->tableWidget_2->item(iCurrentRow, column); +// if (pItem) +// { +// QString strWellName = pItem->text(); +// m_listWell.removeOne(strWellName); +// m_mapFWell.remove(strWellName); +// } + WellHeader* pWheader = qobject_cast(ui->tableWidget_2->cellWidget(iCurrentRow, column)); + if (pWheader) + { + QString strWellName = pWheader->m_strWellName; + m_listWell.removeOne(strWellName); + m_mapFWell.remove(strWellName); + } // ui->tableWidget_2->removeColumn(column); ui->tableWidget_2->removeColumn(column-1);//空白列,注意先删除选中列,否则列号改变 @@ -6685,6 +6700,11 @@ void MainWindowCurve::s_AddMultiWell(QString strUuid, QString strSlfName, QStrin { return; } + // + if(m_listWell.contains(strWellName)) + { + return; + } g_strSlfName = strSlfName; g_strWellName = strWellName;