11 #include <QCoreApplication>
12 #include <QProgressBar>
13 #include <QPushButton>
17 : QProgressDialog(parent), m_currentValue(0), m_lastRefreshValue(-1) {
24 QPushButton* cancelButton = 0;
25 if (showCancelButton) {
26 cancelButton =
new QPushButton(
"Cancel");
27 cancelButton->setDefault(
false);
28 cancelButton->setFocusPolicy(Qt::NoFocus);
30 setCancelButton(cancelButton);
34 Qt::QueuedConnection);
48 int value =
static_cast<int>(percent);
52 QCoreApplication::processEvents();
59 setWindowTitle(methodTitle);
63 setLabelText(infoStr);
65 QProgressDialog::update();
66 QCoreApplication::processEvents();
73 QCoreApplication::processEvents();
78 QCoreApplication::processEvents();
virtual void stop() override
Notifies the fact that the process has ended.
virtual void update(float percent) override
Notifies the algorithm progress.
ecvProgressDialog(bool cancelButton=false, QWidget *parent=0)
Default constructor.
virtual void setInfo(const char *infoStr) override
Notifies some information about the ongoing process.
void refresh()
Refreshes the progress.
QAtomicInt m_currentValue
Current progress value (percent)
void scheduleRefresh()
Schedules a call to refresh.
QAtomicInt m_lastRefreshValue
Last displayed progress value (percent)
virtual void start() override
virtual void setMethodTitle(const char *methodTitle) override
Notifies the algorithm title.