居中优化

This commit is contained in:
jiayulong 2026-06-25 09:32:17 +08:00
parent 90cf020fc3
commit dd52707155
2 changed files with 16 additions and 4 deletions

View File

@ -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上方
}

View File

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