From 8d555aebbea4d2ab188380e0f003da866acf8242 Mon Sep 17 00:00:00 2001 From: jiayulong <22806282@qq.com> Date: Mon, 9 Feb 2026 18:14:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8F=AF=E8=A7=86=E8=A7=A3=E9=87=8A=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=EF=BC=8C=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9A=E5=88=A0=E9=99=A4=E6=9B=B2=E7=BA=BF=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=81=93=E3=80=822.=E6=9B=B2=E7=BA=BF?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 24 +++++++++++ logPlus/formdraw.cpp | 48 +++++++++++++++++---- logPlus/formdraw.h | 4 +- logPlus/formhead.cpp | 6 ++- logPlus/forminfo.cpp | 25 ++++++++++- logPlus/forminfo.h | 22 ++++------ logPlus/formtrack.cpp | 34 +++++++++++++++ logPlus/formtrack.h | 1 + logPlus/formwell.cpp | 84 ++++++++++++++++++++++++++++++++++++- logPlus/formwell.h | 7 ++++ logPlus/mainwindowcurve.cpp | 47 ++++++++++++++++++++- logPlus/mainwindowcurve.h | 4 +- 12 files changed, 274 insertions(+), 32 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 3d3711f..838272d 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -288,6 +288,29 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant emit CallManage::getInstance()->sig_changeDepth(m_strUuid, m_strSlfName, m_strWellName, m_iY1, m_iY2); } } + //曲线--------------------------- + else if("显示名称" == m_propertyData[pProperty]) + { + //qDebug() << "显示名称->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + QString newAliasName = variant.value(); + m_formInfo->m_strAliasName = newAliasName; + m_formInfo->update(); + } + } + else if("显示单位" == m_propertyData[pProperty]) + { + //qDebug() << "显示单位->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + QString newUnit = variant.value(); + m_formInfo->m_strUnit = newUnit; + m_formInfo->update(); + } + } else if("左刻度" == m_propertyData[pProperty]) { //qDebug() << "左刻度->改变"; @@ -1010,6 +1033,7 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt //初始化,清空 InitCurrentViewInfo(); m_strUuid = formInfo->m_strUuid; + m_formInfo = formInfo; // m_strSlfName = formInfo->m_strSlfName; diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index eb9dfaf..15433dd 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -56,8 +56,8 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) : m_nSltk=15.0;//杆状图长度 connect(CallManage::getInstance(), SIGNAL(sig_AddLine(QString, QString, QString, QString, QString)), this, SLOT(s_addLine(QString, QString, QString, QString, QString))); - connect(CallManage::getInstance(), SIGNAL(sig_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle)), - this, SLOT(s_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle))); + connect(CallManage::getInstance(), SIGNAL(sig_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle, QStringList)), + this, SLOT(s_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle, QStringList))); connect(CallManage::getInstance(), SIGNAL(sig_delLine(QString, QString, QString, QString)), this, SLOT(s_delLine(QString, QString, QString, QString))); connect(CallManage::getInstance(), SIGNAL(sig_MouseMove(QString, QString, QString, float)), this, SLOT(s_MouseMove(QString, QString, QString, float))); //波列 @@ -291,6 +291,8 @@ void FormDraw::DisplayLine_One(QJsonObject lineObjInfo) QString strWellName = ""; // QString strTrackName = ""; QString strLineName = ""; + QString strAliasName = "";//显示名称 + QString strUnit = "";//单位 // double newLeftScale = 0;//左刻度 double newRightScale = 500;//右刻度 @@ -354,6 +356,22 @@ void FormDraw::DisplayLine_One(QJsonObject lineObjInfo) //qDebug() << "LineName:" << strLineName; } } + if (lineObjInfo.contains("AliasName")) + { + QJsonValue value = lineObjInfo.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + //qDebug() << "strAliasName:" << strAliasName; + } + } + if (lineObjInfo.contains("Unit")) + { + QJsonValue value = lineObjInfo.value("Unit"); + if (value.isString()) { + strUnit = value.toString(); + //qDebug() << "strUnit:" << strUnit; + } + } if (lineObjInfo.contains("vmin")) { @@ -408,9 +426,12 @@ void FormDraw::DisplayLine_One(QJsonObject lineObjInfo) if (strLineName != "") { + QStringList listOtherProperty; + listOtherProperty.append(strAliasName); + listOtherProperty.append(strUnit); //新建曲线 s_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, - newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); } //--------------- @@ -605,7 +626,7 @@ void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellNam } void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle, QStringList listOtherProperty) { //井名&道名不一致 if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) @@ -660,7 +681,7 @@ AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property"); curv->show(); initForm(curv, strSlfName, strLineName, - newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); @@ -2277,7 +2298,7 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st } void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName, - double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle, QStringList listOtherProperty) { //AppendConsole(PAI_INFO, "FormDraw initForm"); @@ -2309,10 +2330,19 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi QString strAliasName=""; QString strUnit=""; - bool bFind = getAliasNameFromIni(strLineName, strAliasName, strUnit);//曲线别名 - if(!bFind) + if(listOtherProperty.size()>=2) { - strAliasName=strLineName; + strAliasName=listOtherProperty[0]; + strUnit=listOtherProperty[1]; + } + else + { + bool bFind = getAliasNameFromIni(strLineName, strAliasName, strUnit);//曲线别名 + if(!bFind) + { + strAliasName=strLineName; + } + } //最大值,最小值 diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index 81f60df..5769970 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -96,7 +96,7 @@ public: public: void initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName, - double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); + double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine, QStringList listOtherProperty={}); void addRandomGraph(QMyCustomPlot *widget, QVector x, QVector y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit, double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); void setupLineStyleDemo(QMyCustomPlot *customPlot); @@ -213,7 +213,7 @@ signals: public slots: void s_addLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); void s_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle, QStringList listOtherProperty);//新建曲线,带属性 void s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName); void s_MouseMove(QString strUuid, QString strWellName, QString strTrackName, float dep); diff --git a/logPlus/formhead.cpp b/logPlus/formhead.cpp index 2297093..64d4b57 100644 --- a/logPlus/formhead.cpp +++ b/logPlus/formhead.cpp @@ -63,15 +63,17 @@ FormHead::FormHead(QWidget *parent, QString indexID) : //我们让一列也可以滑动 // ui->tableWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); // ui->tableWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - // 设置右键菜单策略 - ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); + // 在窗口构造函数中 //ui->tableWidget->installEventFilter(this); // 设置整个表格的委托,或者特定列的委托 //ui->tableWidget->setItemDelegate(new BackgroundDelegate(ui->tableWidget)); + // 设置右键菜单策略 + ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); // 连接信号和槽 connect(ui->tableWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint))); + //connect(ui->tableWidget, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(slotItemClicked(QTableWidgetItem*))); } diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 4a9d3ea..00d14d6 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "geometryutils.h" #include "qtColorSchemeComboBox.h" @@ -361,7 +362,7 @@ void FormInfo::paintEvent(QPaintEvent* event) if(m_strType=="curveObject") { //曲线 - painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit); + //painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit); } //--------------- if(m_strLineName=="WORDS_RELUST") @@ -840,4 +841,26 @@ void FormInfo::s_ChangeFillMode(QString strUuid, QString strSlfName, QString str } } +void FormInfo::contextMenuEvent(QContextMenuEvent *event) +{ + //曲线 + if(m_strType=="curveObject") + { + QMenu menu(this); + menu.addAction(QIcon(::GetImagePath() + "icon/Sheet.png"), "数据对象查看", this, &FormInfo::onShowCurve); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteObject); + menu.exec(event->globalPos()); + } +} +//数据查看 +void FormInfo::onShowCurve() +{ + emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strLineName); +} + +void FormInfo::onDeleteObject() +{ + //删除曲线 + emit CallManage::getInstance()->sig_delLine(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); +} diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index ff1cf33..2d7e54b 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -141,23 +141,19 @@ public: QJsonObject makeJson(); -//public: -// void mousePressEvent(QMouseEvent *event) override { -// if (event->button() == Qt::LeftButton) { -// startPosition = event->globalPos() - frameGeometry().topLeft(); -// event->accept(); -// } -// } + //右键菜单响应函数 + virtual void contextMenuEvent(QContextMenuEvent *event); -// void mouseMoveEvent(QMouseEvent *event) override { -// if (event->buttons() & Qt::LeftButton) { -// move(event->globalPos() - startPosition); -// event->accept(); -// } -// } private: QPoint startPosition; + +public slots: + //数据查看 + void onShowCurve(); + //删除当前对象 + void onDeleteObject(); + }; diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 9408121..56fedfa 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -47,6 +47,8 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName) //曲线 connect(this, SIGNAL(sig_AddLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)), this, SLOT(s_addLine(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString))); + //删除曲线 + connect(CallManage::getInstance(), SIGNAL(sig_delLine(QString, QString, QString, QString)), this, SLOT(s_delLine(QString, QString, QString, QString))); //波列 connect(this, SIGNAL(sig_AddWave(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)), this, SLOT(s_addWave(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString))); @@ -342,6 +344,38 @@ void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTr // ui->tableWidget->setItem(row, 0, item); } +void FormTrack::s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName) +{ + //井名&道名不一致 + if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) + { + } + else + { + return; + } + // + int rowCount = ui->tableWidget->rowCount(); + for(int i=0; itableWidget->cellWidget(i, 0) != nullptr ) + { + auto myWidget = ui->tableWidget->cellWidget(i, 0); + FormInfo *formInfo = qobject_cast(myWidget);//获得widget + if(formInfo) + { + if(strUuid == formInfo->m_strUuid + && formInfo->m_strWellName == strWellName + && formInfo->m_strTrackName == strTrackName + && formInfo->m_strLineName == strLineName) + { + ui->tableWidget->removeRow(i); + } + } + } + } +} + void FormTrack::s_addWave(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType) { qDebug() << "FormTrack s_addWave"; diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index 99790aa..c871af1 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -88,6 +88,7 @@ signals: public slots: void s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); + void s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName); void s_addWave(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); void s_AddTableLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index 893352c..3569820 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -2,6 +2,8 @@ #include "ui_formwell.h" #include "CallManage.h" #include "qtColorSchemeComboBox.h" +#include "geometryutils.h" +#include "mainwindowcurve.h" extern int g_iOneWidth; //道宽 //extern int m_iY1; @@ -15,7 +17,7 @@ FormWell::FormWell(QWidget *parent, QString strWellName) : ui(new Ui::FormWell) { ui->setupUi(this); - + m_parent = parent; m_strWellName = strWellName; // @@ -26,6 +28,11 @@ FormWell::FormWell(QWidget *parent, QString strWellName) : //ui->tableWidget->verticalHeader()->setFixedWidth(3);//标题栏宽度 ui->tableWidget->horizontalHeader()->setFixedHeight(3); + // 设置右键菜单策略 + ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); + // 连接信号和槽 + connect(ui->tableWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint))); + //关联信号槽 connect(CallManage::getInstance(), SIGNAL(sig_NewTrack(QString, QString, QString, QString, QString,int)), this, SLOT(s_NewTrack(QString, QString, QString, QString, QString,int))); //关联信号槽 @@ -516,3 +523,78 @@ QStringList FormWell::getLineList(QString strWellName, QString strTrackName) return listLine; } + +void FormWell::slotContextMenu(QPoint pos) +{ + // + int columnCount = ui->tableWidget->columnCount();//总列数 + if(columnCount<1) + { + return; + } + //当前列 + int iCurrentCol = ui->tableWidget->currentColumn(); + if(iCurrentCol < 0) + { + return; + } + //当前行 + int iCurrentRow = ui->tableWidget->currentRow(); + if(iCurrentRow == 0) + { + QMenu menu(ui->tableWidget); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中道", this, &FormWell::slotDeleteSelectTrack); + menu.exec(ui->tableWidget->mapToGlobal(pos)); + } +} + +void FormWell::slotDeleteSelectTrack() +{ + //当前列 + int iCurrentCol = ui->tableWidget->currentColumn(); + if(iCurrentCol < 0) + { + return; + } + //当前行 + int iCurrentRow = ui->tableWidget->currentRow(); + if(iCurrentRow == 0) + { + ui->tableWidget->removeColumn(iCurrentCol); + resizeWindow(); + } +} + +void FormWell::resizeWindow() +{ + QRect rect = this->rect(); + int tempWidth = 0; + int tempHight = 0; + + for(int i=0; itableWidget->columnCount(); i++) + { + tempWidth += ui->tableWidget->columnWidth(i); + tempWidth += 1; + } + // + for(int j=0; jtableWidget->rowCount(); j++) + { + tempHight += ui->tableWidget->rowHeight(j); + tempHight += 1; + } + + //调整大小 + if(rect.width()>tempWidth) + { + ui->tableWidget->setGeometry((rect.width()-tempWidth)/2, 2, tempWidth, tempHight); + } + else + { + ui->tableWidget->setGeometry(0, 2, tempWidth, tempHight); + } + +// m_parent = parent; + + MainWindowCurve *parent = (MainWindowCurve *)m_parent; + parent->resizeItem(m_strWellName, tempWidth, tempHight); +} diff --git a/logPlus/formwell.h b/logPlus/formwell.h index 30c4d73..6c3712d 100644 --- a/logPlus/formwell.h +++ b/logPlus/formwell.h @@ -35,6 +35,7 @@ public: int m_iScale=200; double m_iY1=0; double m_iY2=0; + QWidget *m_parent; public: QJsonObject makeJson(); @@ -54,6 +55,12 @@ public slots: void slot_NewTrack_No_Line(QString strUuid, QJsonObject topObj, QJsonObject infoObj); void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType); + + //图头右键菜单响应函数 + void slotContextMenu(QPoint pos); + void slotDeleteSelectTrack(); + + void resizeWindow(); }; #endif // FORMWELL_H diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 755f84d..afff928 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -3218,7 +3218,7 @@ void MainWindowCurve::s_NewTrack_No_Line(QJsonObject topObj, QJsonObject infoObj //新建曲线,带属性 void MainWindowCurve::s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle, QStringList listOtherProperty) { emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, strTrackName, strLineName, newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); @@ -3967,6 +3967,8 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo, QString strTrackN QString strWellName = ""; // QString strTrackName = ""; QString strLineName = ""; + QString strAliasName = "";//显示名称 + QString strUnit = "";//单位 // double newLeftScale = 0;//左刻度 double newRightScale = 500;//右刻度 @@ -4030,6 +4032,22 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo, QString strTrackN //qDebug() << "LineName:" << strLineName; } } + if (lineObjInfo.contains("AliasName")) + { + QJsonValue value = lineObjInfo.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + //qDebug() << "strAliasName:" << strAliasName; + } + } + if (lineObjInfo.contains("Unit")) + { + QJsonValue value = lineObjInfo.value("Unit"); + if (value.isString()) { + strUnit = value.toString(); + //qDebug() << "strUnit:" << strUnit; + } + } if (lineObjInfo.contains("vmin")) { @@ -4084,9 +4102,12 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo, QString strTrackN if(strLineName!="") { + QStringList listOtherProperty; + listOtherProperty.append(strAliasName); + listOtherProperty.append(strUnit); //新建曲线 s_AddLine_Property(strSlfName, strWellName, strTrackName, strLineName, - newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); } //--------------- @@ -4196,3 +4217,25 @@ void MainWindowCurve::DisplayType_One(QJsonObject lineObjInfo, QString strTrackN //新建道 emit CallManage::getInstance()->sig_NewCol(dt); } + +void MainWindowCurve::resizeItem(QString strWellName, double colWidth, double rowHight) +{ + int column = ui->tableWidget_2->columnCount(); + for(int i=0; itableWidget_2->item(0, i)->text(); + if(strWellNameTemp==strWellName) + { + ui->tableWidget_2->setColumnWidth(i, colWidth+8); + } + } +} diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 973e8b3..963cc9f 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -40,7 +40,7 @@ private: protected: public: - + void resizeItem(QString strWellName, double tempWidth, double tempHight); public slots: void dragEnterEvent(QDragEnterEvent* event); @@ -164,7 +164,7 @@ public slots: void s_NewTrack_No_Line(QJsonObject topObj, QJsonObject infoObj);//新建空白道,没有曲线 void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle, QStringList listOtherProperty);//新建曲线,带属性 void s_NewTrack(); // 新建道 void s_NewDepth(); // 深度