OpendTect  6.3
qtimercomm.h
Go to the documentation of this file.
1 #ifndef qtimercomm_h
2 #define qtimercomm_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: March 2009
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include <QTimer>
15 #include "timer.h"
16 
17 QT_BEGIN_NAMESPACE
18 
25 class QTimerComm : public QObject
26 {
27  Q_OBJECT
28  friend class ::Timer;
29 
30 protected:
31 
32 QTimerComm( QTimer* qtimer, Timer* timer )
33  : qtimer_(qtimer)
34  , timer_(timer)
35  , magic_( 0xdeadbeef )
36 {
37  connect( qtimer, SIGNAL(timeout()), this, SLOT(timeout()) );
38 }
39 
40 public:
41 
42 virtual ~QTimerComm()
43 { deactivate(); }
44 
45 
46 void deactivate()
47 {
48  if ( qtimer_ && magic_ == 0xdeadbeef )
49  qtimer_->stop();
50 
51  qtimer_ = 0;
52  timer_ = 0;
53  magic_ = 0;
54 }
55 
56 private slots:
57 
58 void timeout()
59 {
60  if ( timer_ && magic_ == 0xdeadbeef )
62 }
63 
64 private:
65 
66  QTimer* qtimer_;
68  unsigned int magic_;
69 
70 };
71 
72 QT_END_NAMESPACE
73 
74 #endif
void notifyHandler()
QTimerComm(QTimer *qtimer, Timer *timer)
Definition: qtimercomm.h:32
unsigned int magic_
Definition: qtimercomm.h:68
QTimer * qtimer_
Definition: qtimercomm.h:66
void deactivate()
Definition: qtimercomm.h:46
void timeout()
Definition: qtimercomm.h:58
QTimer communication class.
Definition: qtimercomm.h:25
Timer * timer_
Definition: qtimercomm.h:67
virtual ~QTimerComm()
Definition: qtimercomm.h:42
Timer class.
Definition: timer.h:24

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017