From 8ee53acc58914069b22d583a15361eb86661ceb5 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 18 May 2026 10:50:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9B=B2=E7=BA=BF=E7=9A=84=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E7=AD=89=E5=9F=BA=E7=A1=80=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=88=B0=E5=85=B6=E5=AE=83=E9=81=93=E5=90=8E=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E4=B8=8D=E5=8F=98=E3=80=82=202.=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=A1=B5=E9=AB=98=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E9=85=8D=E7=BD=AE=E9=AB=98=E5=BA=A6=E4=BD=8E?= =?UTF-8?q?=E4=BA=8E=E5=88=86=E8=BE=A8=E7=8E=87=EF=BC=8C=E6=80=8E=E9=87=87?= =?UTF-8?q?=E7=94=A8=E5=88=86=E8=BE=A8=E7=8E=87=E9=AB=98=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formdraw.cpp | 54 +++++++++++++++++-- logPlus/mainwindow.cpp | 15 ++++++ logPlus/preqtablewidget.cpp | 102 ++++++++++++++++++++++++++++++++++-- 3 files changed, 164 insertions(+), 7 deletions(-) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 69c88cd..4d03ff4 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -7369,8 +7369,44 @@ void FormDraw::dropEvent(QDropEvent* event) { if(strType=="curveObject") { - //新建曲线 - emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 5) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + // + QString strListPropertyMain = list[5]; + QStringList listMainProperty = strListPropertyMain.split(", "); // 以逗号加空格为分隔符分割字符串 + + // + if (listMainProperty.size() > 5) + { + double newLeftScale; + double newRightScale; + QString strScaleType; + QColor lineColor; + double width; + Qt::PenStyle lineStyle; + // + newLeftScale = listMainProperty[0].toDouble(); + newRightScale = listMainProperty[1].toDouble(); + strScaleType = listMainProperty[2]; + lineColor.setNamedColor(listMainProperty[3]); + width = listMainProperty[4].toDouble(); + lineStyle = (Qt::PenStyle)listMainProperty[5].toInt(); + + //新建曲线 + emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } } else if(strType=="waveObject") { @@ -7430,8 +7466,18 @@ void FormDraw::dropEvent(QDropEvent* event) } else if(strType=="LogfaceObject") { - //沉积相 - emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 4) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); + } + else + { + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } } else if(strType=="MCalsObject") { diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index 8fe9fdd..098a6e5 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -179,6 +179,21 @@ void MainWindow::ReadConfig() int iHeight = 10000; //读取,MyCustom界面高度 qtCommon->readHeight(configPath, iHeight); + if(iHeight == 0) + { + } + else if(iHeight == 1) + { + } + else + { + if(iHeight < QApplication::desktop()->height()) + { + //不能低于分辨率 + iHeight = QApplication::desktop()->height(); + } + } + g_iHeight_MyCustom = iHeight; //Debug模式 diff --git a/logPlus/preqtablewidget.cpp b/logPlus/preqtablewidget.cpp index 54e8619..3feb147 100644 --- a/logPlus/preqtablewidget.cpp +++ b/logPlus/preqtablewidget.cpp @@ -113,7 +113,45 @@ void PreQTableWidget::dropEvent(QDropEvent *event) if(strType=="curveObject") { //新建曲线 - emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 5) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + // + QString strListPropertyMain = list[5]; + QStringList listMainProperty = strListPropertyMain.split(", "); // 以逗号加空格为分隔符分割字符串 + + // + if (listMainProperty.size() > 5) + { + double newLeftScale; + double newRightScale; + QString strScaleType; + QColor lineColor; + double width; + Qt::PenStyle lineStyle; + // + newLeftScale = listMainProperty[0].toDouble(); + newRightScale = listMainProperty[1].toDouble(); + strScaleType = listMainProperty[2]; + lineColor.setNamedColor(listMainProperty[3]); + width = listMainProperty[4].toDouble(); + lineStyle = (Qt::PenStyle)listMainProperty[5].toInt(); + + //新建曲线 + emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } else if(strType=="waveObject") { @@ -361,10 +399,61 @@ void PreQTableWidget::performDrag() //属性信息 QString strListPropertyText = ""; + QString strListPropertyMain = ""; if(strType=="curveObject") { //曲线 + //此处属性注意顺序,后续使用按照顺序 + QStringList listOtherProperty; + listOtherProperty.append(formInfo->m_strAliasName); + listOtherProperty.append(formInfo->m_strUnit); + listOtherProperty.append(formInfo->m_curveNameFont.toString());//曲线名称字体 + if(formInfo->m_bDrawLine) + { + listOtherProperty.append("DrawLine"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawGan) + { + listOtherProperty.append("DrawGan"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawPoint) + { + listOtherProperty.append("DrawPoint"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawSymmetry) + { + listOtherProperty.append("DrawSymmetry"); + } + else{ + listOtherProperty.append("0"); + } + // + listOtherProperty.append(QString::number(formInfo->m_pointStyle)); + // + strListPropertyText = listOtherProperty.join(", "); // 合并成一个字符串,元素之间用逗号加空格分隔 + // + QStringList listMainProperty; + listMainProperty.append(QString::number(formInfo->m_vmin)); + listMainProperty.append(QString::number(formInfo->m_vmax)); + listMainProperty.append(formInfo->m_strScaleType); + listMainProperty.append(formInfo->m_lineColor.name()); + listMainProperty.append(QString::number(formInfo->m_dWidth)); + listMainProperty.append(QString::number(formInfo->m_lineStyle)); + // + strListPropertyMain = listMainProperty.join(", "); // 合并成一个字符串,元素之间用逗号加空格分隔 } else if(strType=="waveObject") { @@ -473,12 +562,19 @@ void PreQTableWidget::performDrag() // 这里需要根据你的item数据来设置mimeData,例如: if(strListPropertyText == "") { - mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType); } else { - mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText); + if(strListPropertyMain == "") + { + mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText); + } + else + { + //曲线额外补充属性 + mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText+ "#@@#" + strListPropertyMain); + } } // 创建QDrag对象 QDrag *drag = new QDrag(this);