fw4spl
t/include/fwGuiQt/dialog/ProgressDialog.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWGUIQT_DIALOG_PROGRESSDIALOG_HPP__
8 #define __FWGUIQT_DIALOG_PROGRESSDIALOG_HPP__
9 
10 #include "fwGuiQt/config.hpp"
11 #include "fwGuiQt/container/QtContainer.hpp"
12 
13 #include <fwGui/dialog/IProgressDialog.hpp>
14 
15 #include <QApplication>
16 #include <QMainWindow>
17 #include <QPointer>
18 #include <QProgressBar>
19 #include <QProgressDialog>
20 #include <QPushButton>
21 #include <QStatusBar>
22 #include <QString>
23 
24 #include <string>
25 
26 QT_BEGIN_NAMESPACE
27 class QProgressDialog;
28 QT_END_NAMESPACE
29 
30 namespace fwGuiQt
31 {
32 namespace dialog
33 {
40 class FWGUIQT_CLASS_API ProgressDialog : public QObject,
42 {
43 Q_OBJECT
44 
45 public:
46 
48  (()),
49  ::fwGui::factory::New< ProgressDialog > )
50 
51  FWGUIQT_API ProgressDialog( ::fwGui::GuiBaseObject::Key key,
52  const std::string& title = "Progression",
53  const std::string& message = std::string(86, ' ') );
54 
55  FWGUIQT_API virtual ~ProgressDialog();
56 
57  FWGUIQT_API void operator()(float percent, std::string msg) override;
58 
60  FWGUIQT_API void setTitle(const std::string& title) override;
61 
63  FWGUIQT_API void setMessage(const std::string& message) override;
64 
65  FWGUIQT_API void hideCancelButton() override;
66 
67 protected Q_SLOTS:
68  void cancelPressed() override;
69 
70 protected:
71 
72  QString m_title;
73 
74  QPointer< QProgressDialog > m_pdialog;
75  QPointer< QProgressBar > m_pprogressbar;
76  QPointer< QPushButton > m_pcancelButton;
77  QPointer< QMainWindow > m_pmainWindow;
78 
79 };
80 } // namespace dialog
81 } // namespace fwGuiQt
82 
83 #endif /* __FWGUIQT_DIALOG_PROGRESSDIALOG_HPP__ */
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
STL namespace.
This class allows us to select an acquisition in a patient data base.
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Defines the generic Progress dialog for IHM.