OpendTect-6_4  6.4
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  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include <QTimer>
16 #include "timer.h"
17 
18 QT_BEGIN_NAMESPACE
19 
26 class QTimerComm : public QObject
27 {
28  Q_OBJECT
29  friend class ::Timer;
30 
31 protected:
32 
33 QTimerComm( QTimer* qtimer, Timer* timer )
34  : qtimer_(qtimer)
35  , timer_(timer)
36  , magic_( 0xdeadbeef )
37 {
38  connect( qtimer, SIGNAL(timeout()), this, SLOT(timeout()) );
39 }
40 
41 public:
42 
43 virtual ~QTimerComm()
44 { deactivate(); }
45 
46 
47 void deactivate()
48 {
49  if ( qtimer_ && magic_ == 0xdeadbeef )
50  qtimer_->stop();
51 
52  qtimer_ = 0;
53  timer_ = 0;
54  magic_ = 0;
55 }
56 
57 private slots:
58 
59 void timeout()
60 {
61  if ( timer_ && magic_ == 0xdeadbeef )
63 }
64 
65 private:
66 
67  QTimer* qtimer_;
69  unsigned int magic_;
70 
71 };
72 
73 QT_END_NAMESPACE
74 
75 #endif
void notifyHandler()
QTimerComm(QTimer *qtimer, Timer *timer)
Definition: qtimercomm.h:33
unsigned int magic_
Definition: qtimercomm.h:69
QTimer * qtimer_
Definition: qtimercomm.h:67
void deactivate()
Definition: qtimercomm.h:47
void timeout()
Definition: qtimercomm.h:59
QTimer communication class.
Definition: qtimercomm.h:26
Timer * timer_
Definition: qtimercomm.h:68
virtual ~QTimerComm()
Definition: qtimercomm.h:43
Timer class.
Definition: timer.h:25

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