追加“原尺寸”按钮,恢复缩放前的大小

This commit is contained in:
jiayulong 2026-06-26 15:02:23 +08:00
parent 67c13b4f6d
commit 19774964d9
2 changed files with 26 additions and 2 deletions

View File

@ -981,6 +981,7 @@ void MainWindowCurve::initMainToolBar()
QIcon sizeIcon(::GetImagePath()+"icon/full_scale.png");
QIcon zoominIcon(::GetImagePath()+"icon/zoomin.png");
QIcon zoomoutIcon(::GetImagePath()+"icon/zoomout.png");
QIcon zoomoldIcon(::GetImagePath()+"icon/full_scale.png");
QIcon wellTopAlignIcon(::GetImagePath()+"WellInterp/井顶对齐.png");
QIcon wellsSpaceIcon(::GetImagePath()+"WellInterp/井间距离.png");
@ -994,6 +995,7 @@ void MainWindowCurve::initMainToolBar()
m_zoomAc = new QAction(zoomIcon, "缩放", this);
m_zoominAc = new QAction(zoominIcon, "放大", this);
m_zoomoutAc = new QAction(zoomoutIcon, "缩小", this);
m_zoomoldAc = new QAction(zoomoldIcon, "原尺寸", this);
m_SaveAsPictureAc = new QAction(SaveAsPictureIcon, "导出长图", this);
m_SaveAsPdfAc = new QAction(SaveAsPdfIcon, "导出PDF", this);
m_SaveAsSvgAc = new QAction(SaveAsSvgIcon, "导出SVG", this);
@ -1025,6 +1027,7 @@ void MainWindowCurve::initMainToolBar()
QMenu* menuZoom = new QMenu(this);
menuZoom->addAction(m_zoominAc); //放大
menuZoom->addAction(m_zoomoutAc); //缩小
menuZoom->addAction(m_zoomoldAc); //还原
zoomMenuAction->setMenu(menuZoom);
// 导出成果图
@ -1116,6 +1119,7 @@ void MainWindowCurve::initMainToolBar()
connect(m_zoomAc, &QAction::triggered, this, &MainWindowCurve::s_Zoom);
connect(m_zoominAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomIn);
connect(m_zoomoutAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomOut);
connect(m_zoomoldAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomOld);
connect(m_SaveAsPictureAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPicture);
connect(m_SaveAsPdfAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPdf);
connect(m_SaveAsSvgAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsSvg);
@ -4163,14 +4167,28 @@ void MainWindowCurve::s_Zoom()
void MainWindowCurve::s_ZoomIn()
{
//宽度放大
ZoomIn(1.1);
double dCurScale = (double)1.0 / (double)0.9;
ZoomIn(dCurScale);//1.1
//
m_dScale = m_dScale/dCurScale;
}
//缩小
void MainWindowCurve::s_ZoomOut()
{
//宽度缩小
ZoomIn(0.9);
double dCurScale = 0.9;
ZoomIn(dCurScale);
//
m_dScale = m_dScale/dCurScale;
}
//还原
void MainWindowCurve::s_ZoomOld()
{
ZoomIn(m_dScale);
//
m_dScale = 1.0;
}
//导出长图

View File

@ -263,6 +263,7 @@ public:
QAction* m_zoomAc = nullptr; //缩放
QAction* m_zoominAc = nullptr; //放大
QAction* m_zoomoutAc = nullptr; //缩小
QAction* m_zoomoldAc = nullptr; //还原
QAction* m_SaveAsPictureAc = nullptr; //导出长图
QAction* m_SaveAsPdfAc = nullptr; //导出PDF
QAction* m_SaveAsSvgAc = nullptr; //导出SVG
@ -289,6 +290,8 @@ public:
//参数卡深度平移校正
QTextEdit *pTDialog;
//缩放还原
double m_dScale = 1.0;
public slots:
void s_NewWell(QString strWellName, QString strSlfName, bool bShowTrackHead = true);//新建井
void s_NewTrackChangeWidth(QString strWellName, double nW=0);//新建道后,改变井宽
@ -396,9 +399,12 @@ public slots:
void s_ZONEDataTable(); //分段生成数据表
void s_SetDataTableFormat();//设置数据表格式
void s_ReFreshZONEDataTable();//按深度表更新数据表
//
void s_Zoom(); //缩放
void s_ZoomIn(); //放大
void s_ZoomOut(); //缩小
void s_ZoomOld(); //还原
void s_Black(); //黑白图
void s_DoubleHead(); //单曲线头
void s_ExecuteDepthShift(); //校深