From dd5270715540f1779b533cc0f2c172080887b682 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Thu, 25 Jun 2026 09:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E4=B8=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formmultiheads.cpp | 14 +++++++++++++- logPlus/mainwindowcurve.cpp | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/logPlus/formmultiheads.cpp b/logPlus/formmultiheads.cpp index aa06182..e0cce74 100644 --- a/logPlus/formmultiheads.cpp +++ b/logPlus/formmultiheads.cpp @@ -386,7 +386,12 @@ void FormMultiHeads::getTableSize(int &iWidth, int &iHight) else { iHight = ui->tableWidget->height(); iWidth = ui->tableWidget->width(); - iHight = iHight + 9; //Margin上方 + // + int left, top, right, bottom; + this->getContentsMargins(&left, &top, &right, &bottom); + + // + iHight = iHight + top + bottom; //Margin上方 } } @@ -427,4 +432,11 @@ void FormMultiHeads::getTableSize_Biggest(int &iWidth_Big, int &iHight_Big) } } } + + // + int left, top, right, bottom; + this->getContentsMargins(&left, &top, &right, &bottom); + + iWidth_Big = iWidth_Big + left + right; + iHight_Big = iHight_Big + top + bottom;//Margin上方 } diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 614a1c9..8c671b4 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -5217,6 +5217,9 @@ void MainWindowCurve::s_showHeadTable_ByClick() if(m_fixwellsectionHeaderAc->isChecked()) { QMessageBox::information(NULL,"提示","锁头完成!",QMessageBox::Ok); + + //居中 + emit sig_resizeWindow(); } } @@ -5261,9 +5264,6 @@ void MainWindowCurve::s_showHeadTable() } ui->verticalScrollBar->setRange(-m_iY2*100, -m_iY1*100 - iScreenHeight + iHScrollBarHeight); ui->verticalScrollBar->setValue(-m_iY2*100); - - //居中 - emit sig_resizeWindow(); } else { //第一次显示,判断是否从json加载