Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkProgressBar.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKPROGRESSBAR_H
18 #define QMITKPROGRESSBAR_H
19 
20 #include <MitkQtWidgetsExports.h>
21 
22 #include <QProgressBar>
24 
33 {
34  Q_OBJECT
35 
36 public:
37  //##Documentation
38  //##@brief Constructor;
39  //## holds param instance internally and connects this to the mitkProgressBar
40  QmitkProgressBar(QWidget *parent = nullptr, const char *name = nullptr);
41 
42  //##Documentation
43  //##@brief Destructor
44  virtual ~QmitkProgressBar();
45 
46  //##Documentation
47  //## @brief Sets whether the current progress value is displayed.
48  virtual void SetPercentageVisible(bool visible) override;
49 
50  //##Documentation
51  //## @brief Adds steps to totalSteps.
52  virtual void AddStepsToDo(unsigned int steps) override;
53 
54  //##Documentation
55  //## @brief Sets the current amount of progress to current progress + steps.
56  //## @param: steps the number of steps done since last Progress(int steps) call.
57  virtual void Progress(unsigned int steps) override;
58 
59 signals:
60 
61  void SignalAddStepsToDo(unsigned int steps);
62  void SignalProgress(unsigned int steps);
63  void SignalSetPercentageVisible(bool visible);
64 
65 protected slots:
66 
67  virtual void SlotAddStepsToDo(unsigned int steps);
68  virtual void SlotProgress(unsigned int steps);
69  virtual void SlotSetPercentageVisible(bool visible);
70 
71 private:
72  //##Documentation
73  //## @brief Reset the progress bar. The progress bar "rewinds" and shows no progress.
74  void Reset() override;
75 
76  unsigned int m_TotalSteps;
77 
78  unsigned int m_Progress;
79 };
80 
81 #endif /* define QMITKPROGRESSBAR_H */
GUI indepentent Interface for all Gui depentent implementations of a ProgressBar. ...
virtual void Progress(unsigned int steps)=0
Sets the current amount of progress to current progress + steps.
virtual void SetPercentageVisible(bool visible)=0
Sets whether the current progress value is displayed.
#define MITKQTWIDGETS_EXPORT
QT-Toolkit/GUI dependent class that provides the QT's ProgressBar.
virtual void Reset()=0
Explicitly reset progress bar.
virtual void AddStepsToDo(unsigned int steps)=0
Adds steps to totalSteps.