From 87d87d0332976d670d7a24e782fb07423103e54e Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Wed, 3 Jun 2026 10:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=A6=86=E7=9B=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8F=90=E7=A4=BA=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataOutput/src/TranSlf2Data.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/DataOutput/src/TranSlf2Data.cpp b/DataOutput/src/TranSlf2Data.cpp index 2fb23f0..6b55071 100644 --- a/DataOutput/src/TranSlf2Data.cpp +++ b/DataOutput/src/TranSlf2Data.cpp @@ -1750,9 +1750,9 @@ void TranToDat(CMemRdWt *mrw,QString Outfile,float Outsdep,float Outedep,float O if(ss.suffix().isEmpty()) cs=cs+".dat"; else if(ss.suffix().compare("dat",Qt::CaseInsensitive)) cs.replace("."+ss.suffix(),".dat"); if(ss.exists()) { - CString str; - str.Format("当前dat文件%s已存在,是否覆盖?",Outfile.toUtf8().data()); - if(QMessageBox::information(NULL,"提示",QString(str.GetString()),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) + QString str; + str = "当前dat文件" + Outfile + "已存在,是否覆盖?"; + if(QMessageBox::information(NULL,"提示", str ,QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { QDir ss; ss.remove(cs); @@ -1946,8 +1946,9 @@ void TranToWis(CMemRdWt *mrw,QString Outfile,float Outsdep,float Outedep,float O QFile w(Outfile); if(w.exists()) { - str.Format("当前wis文件%s已存在,是否覆盖?",Outfile.toUtf8().data()); - if(QMessageBox::information(NULL,"提示",QString(str.GetString()),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) + QString str; + str = "当前wis文件" + Outfile + "已存在,是否覆盖?"; + if(QMessageBox::information(NULL,"提示", str ,QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { w.remove(); } @@ -2718,14 +2719,15 @@ void TranToLis(CMemRdWt *mrw,QString Outfile,float Outsdep,float Outedep,float O if(Outedep == -9999.0) Outedep = maxedep; if(Outrlev == -9999.0) Outrlev = maxrlev; - - CString str; + QString str; //打开xtf文件 QFile w(Outfile); if(w.exists()) { - str.Format("当前Lis文件%s已存在,是否覆盖?",Outfile.toUtf8().data()); - if(QMessageBox::information(NULL,"提示",QString(str.GetString()),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) + // str.Format("当前Lis文件%s已存在,是否覆盖?",Outfile.toUtf8().data()); + // if(QMessageBox::information(NULL,"提示",QString(str.GetString()),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) + str = "当前Lis文件" + Outfile + "已存在,是否覆盖?"; + if(QMessageBox::information(NULL,"提示",str,QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { w.remove(); } @@ -2739,7 +2741,8 @@ void TranToLis(CMemRdWt *mrw,QString Outfile,float Outsdep,float Outedep,float O int ret=lis_lib.OpenDataFile(Outfile,1); if(ret<1) { - str.Format("%s 创建失败 !!!",Outfile.toUtf8().data()); + // str.Format("%s 创建失败 !!!",Outfile.toUtf8().data()); + str = Outfile + " 创建失败 !!!"; AfxMessageBox(str); return; } @@ -3025,13 +3028,13 @@ void TranToXtf(CMemRdWt *mrw,QString Outfile,float Outsdep,float Outedep,float O tempr = Outrlev; //遗留问题:只处理了ushort、short或float三种数据类型 - CString str; + QString str; //打开xtf文件 QFile w(Outfile); if(w.exists()) { - str.Format("当前xtf文件%s已存在,是否覆盖?",Outfile.toUtf8().data()); - if(QMessageBox::information(NULL,"提示",QString(str.GetString()),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) + str = "当前xtf文件" + Outfile + "已存在,是否覆盖?"; + if(QMessageBox::information(NULL,"提示",str,QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { w.remove(); }