CEDRIC  Revision_backup-2009-02
GlobalProgressIndicator.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2008 Max Hermann
4  *
5  * This file is part of the "CEDRIC Event Display" application.
6  *
7  *****************************************************************************/
8 
9 #ifndef GLOBALPROGRESSINDICATOR_H
10 #define GLOBALPROGRESSINDICATOR_H
11 
12 #include "ProgressIndicator.h"
13 class QProgressDialog;
14 class QWidget;
15 
16 #include <QString>
17 
19 {
20 public:
21  void centerOn( QWidget* w );
22  void setRegent( QWidget* r ) { m_regent = r; };
23 
24  void setTitle( const QString& title );
25  void setLabel( const QString& label );
26 
27 protected:
28  bool onPoll();
29  void onStart();
30  void onFinish();
31  void onRangeChange( int min, int max );
32 
33 private:
34  QProgressDialog* m_qpd;
35  QWidget* m_regent;
36 
39 public:
41  {
42  static GlobalProgressIndicator singleton;
43  return singleton;
44  }
45 
46 private:
48  virtual ~GlobalProgressIndicator();
49  GlobalProgressIndicator( const GlobalProgressIndicator& /*singleton*/ )
51  {}
52  GlobalProgressIndicator& operator = ( const GlobalProgressIndicator& /*singleton*/ )
53  { return *this; }
55 };
56 
57 #endif // GLOBALPROGRESSINDICATOR
void setLabel(const QString &label)
Definition: GlobalProgressIndicator.cpp:37
void setTitle(const QString &title)
Definition: GlobalProgressIndicator.cpp:32
Definition: GlobalProgressIndicator.h:18
static GlobalProgressIndicator & ref()
Definition: GlobalProgressIndicator.h:40
void onFinish()
Definition: GlobalProgressIndicator.cpp:90
std::string title() const
Definition: ProgressIndicator.h:113
void centerOn(QWidget *w)
Definition: GlobalProgressIndicator.cpp:42
void onStart()
Definition: GlobalProgressIndicator.cpp:66
void onRangeChange(int min, int max)
Definition: GlobalProgressIndicator.cpp:99
std::string label() const
Definition: ProgressIndicator.h:115
void setRegent(QWidget *r)
Definition: GlobalProgressIndicator.h:22
Interface for a polling-based progress indicator (e.g. progress bar)
Definition: ProgressIndicator.h:37
bool onPoll()
Definition: GlobalProgressIndicator.cpp:48