diff options
Diffstat (limited to 'progressdialog.cpp')
-rw-r--r-- | progressdialog.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/progressdialog.cpp b/progressdialog.cpp index 778a3b4..f354a07 100644 --- a/progressdialog.cpp +++ b/progressdialog.cpp @@ -17,9 +17,18 @@ ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(par mainLayout->addWidget(mLabel); mainLayout->addWidget(mProgress); mainLayout->addLayout(btnLayout); + setMaximumWidth(400); + setMinimumWidth(400); setLayout(mainLayout); } +void ProgressDialog::setLabelText(const QString &text){ + QFontMetrics fm(mLabel->font()); + int width = mLabel->width() - 4; + QString fixed = fm.elidedText(text, Qt::ElideRight, width); + mLabel->setText(fixed); +} + void ProgressDialog::setValue(int val){ mProgress->setValue(val); } |