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加载