9 #include <QFutureWatcher> 10 #include <QApplication> 11 #include <QtConcurrent> 13 #include <fwCore/base.hpp> 14 #include <fwGui/registry/macros.hpp> 17 #include "fwGuiQt/dialog/PulseProgressDialog.hpp" 31 m_pdialog =
new QProgressDialog(qApp->activeWindow());
36 PulseProgressDialog::~PulseProgressDialog()
49 m_pdialog->setWindowTitle(QString::fromStdString(title));
56 m_pdialog->setLabelText(QString::fromStdString(msg));
64 QFutureWatcher<void> futureWatcher;
65 QObject::connect(&futureWatcher, SIGNAL(finished()), m_pdialog, SLOT(reset()));
66 QObject::connect(m_pdialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
67 QObject::connect(&futureWatcher, SIGNAL(progressRangeChanged(
int,
int)), m_pdialog, SLOT(setRange(
int,
int)));
68 QObject::connect(&futureWatcher, SIGNAL(progressValueChanged(
int)), m_pdialog, SLOT(setValue(
int)));
71 futureWatcher.setFuture(QtConcurrent::run(m_stuff));
This class allows us to show a pulse progress bar.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
static FWGUI_API const FactoryRegistryKeyType REGISTRY_KEY
this unique key should be used for all factory for specific LocationDialog(qt,wx,...)
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
FWGUIQT_API void setTitle(const std::string &title) override
override
FWGUIQT_API void setMessage(const std::string &message) override
override
FWGUIQT_API void show() override
show the pulse progress dialog