Рефакт Message Item

This commit is contained in:
2025-09-11 14:48:38 +03:00
parent 2066925844
commit a5431175d9
3 changed files with 47 additions and 51 deletions

View File

@@ -90,8 +90,8 @@ void MsgWidget::on_editText_textChanged()
if(textRect.width() > widthEdit)
{//Не помещается в одну строку
textRect = metricsFont.boundingRect(QRect(0, 0, widthEdit, 1000), 0, text);
textRect = metricsFont.boundingRect(QRect(0, 0, widthEdit, 1000), 0, text);
if(textRect.width() > widthEdit)
{
@@ -109,13 +109,12 @@ void MsgWidget::on_editText_textChanged()
{
this->setFixedHeight(textRect.height() + X + 20 + 30);
ui->editText->setFixedHeight(textRect.height() + X);
}
}
else
{//В одну строку
this->setFixedHeight(textRect.height() + X + 20 + 30);
ui->editText->setFixedWidth(textRect.width() + X);
ui->editText->setFixedHeight(textRect.height() + X);
this->setFixedHeight(textRect.height() + X + 20 + 30);
}
}