fix: worklist dialog error message display incomplete.

This commit is contained in:
sunwen
2024-06-12 17:16:21 +08:00
parent b873a1d1a7
commit 404ed6234b
3 changed files with 290 additions and 164 deletions

View File

@@ -126,6 +126,7 @@ void GetWorkListDialog::initializeContentWidgets()
//ErrorLabel
contentLayout->addWidget(mErrorLabel);
mErrorLabel->setObjectName("warn");
mErrorLabel->setWordWrap(true);
mErrorLabel->hide();
}
@@ -155,6 +156,10 @@ bool GetWorkListDialog::updateReferenceData()
if (accessionNum.isEmpty() && patientId.isEmpty())
{
mErrorLabel->setText(tr("Accession Number and Patient Id is Empty."));
QFont font = mErrorLabel->font();
QFontMetrics metrics(font);
int width = metrics.width(mErrorLabel->text());
mErrorLabel->setFixedHeight(metrics.lineSpacing() * (width / this->width()) + 40 );
mErrorLabel->show();
return false;
}