diff options
Diffstat (limited to 'progressdialog.cpp')
-rw-r--r-- | progressdialog.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/progressdialog.cpp b/progressdialog.cpp new file mode 100644 index 0000000..778a3b4 --- /dev/null +++ b/progressdialog.cpp @@ -0,0 +1,25 @@ +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QPushButton> + +#include "progressdialog.h" + +ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ + mLabel = new QLabel; + mProgress = new QProgressBar; + QPushButton *cancelBtn = new QPushButton(tr("Cancel")); + connect(cancelBtn, SIGNAL(clicked()), this, SIGNAL(cancelled())); + QHBoxLayout *btnLayout = new QHBoxLayout; + btnLayout->addStretch(); + btnLayout->addWidget(cancelBtn); + btnLayout->addStretch(); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(mLabel); + mainLayout->addWidget(mProgress); + mainLayout->addLayout(btnLayout); + setLayout(mainLayout); +} + +void ProgressDialog::setValue(int val){ + mProgress->setValue(val); +} |