Skip to content
Snippets Groups Projects

Features 5865

Merged stanislav.ratseburzhinskii requested to merge features-5865 into release-7.1
4 files
+ 32
2
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 23
1
@@ -25,6 +25,8 @@ PopupDialog::PopupDialog (QWidget *parent) :
setFixedSize (sz);
setMinimumSize (sz);
setMaximumSize (sz);
dafaultHeight = hh;
dafaultTextHeight = ui->lDescription->height();
qDebug() << "PopupDialog::Construct size:" << sz;
@@ -92,12 +94,32 @@ void PopupDialog::slotShow (
if (a_btnNo.isEmpty()){
ui->btnNo->hide();
// ui->spacer->hide();
ui->spacer->hide();
}
if (a_btnYes.isEmpty()){
ui->btnYes->hide();
ui->spacer->hide();
}
ui->btnYes->setText (a_btnYes);
ui->btnNo->setText (a_btnNo);
/* text size */
int th = ui->lDescription->fontMetrics().boundingRect(QRect(0,0,100,100), 0, a_description).height();
if (th > dafaultTextHeight)
{
// increase window size
setMinimumHeight (dafaultHeight + th - dafaultTextHeight);
setMaximumHeight (dafaultHeight + th - dafaultTextHeight);
}
else
{
// default size
setMinimumHeight (dafaultHeight);
setMaximumHeight (dafaultHeight);
}
/* display */
show();
}
Loading