fix: 修复bug85738

Description: 识别的图标居中,文字居中

Log: 识别的图标居中,文字居中

Bug: https://pms.uniontech.com/zentao/bug-view-85738.html
Change-Id: Id24f60d5a691061af0533e25e343798fdbfd5f01
This commit is contained in:
liuminghang 2021-07-05 16:47:40 +08:00
parent 8606ef1251
commit 885b77468b

View File

@ -284,12 +284,14 @@ void MainWidget::loadingUi()
if (m_loadingWidget && m_loadingTip && m_resultWidget) { if (m_loadingWidget && m_loadingTip && m_resultWidget) {
int x = this->width() - m_resultWidget->width() / 2; int x = this->width() - m_resultWidget->width() / 2;
int y = this->height() / 2 - 50; int y = this->height() / 2 - 50;
m_loadingWidget->move(x, y); qDebug() << m_loadingWidget->width();
m_loadingWidget->setFixedSize(QSize(24, 24));
m_loadingWidget->move(x - m_loadingWidget->width() / 2, y);
qDebug() << m_loadingTip->width(); qDebug() << m_loadingTip->width();
// m_loadingTip->setAlignment(Qt::AlignCenter); // m_loadingTip->setAlignment(Qt::AlignCenter);
QFontMetrics fm(DFontSizeManager::instance()->get(DFontSizeManager::T8)); QFontMetrics fm(DFontSizeManager::instance()->get(DFontSizeManager::T8));
int mPoint = fm.boundingRect(tr("Recognizing")).width(); int mPoint = fm.boundingRect(tr("Recognizing")).width();
m_loadingTip->move(x - mPoint / 2 + 7, y + 24); m_loadingTip->move(x - mPoint / 2 - 4, y + 24);
} }
if (m_pwidget) { if (m_pwidget) {
m_pwidget->setFixedSize(this->width(), this->height() - 48); m_pwidget->setFixedSize(this->width(), this->height() - 48);