Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
QtTimer.h
1/*=======================================================================
2** VSG_COPYRIGHT_TAG
3**=======================================================================*/
4/*=======================================================================
5** Author : Benjamin Grange (MMM YYYY)
6**=======================================================================*/
7
8#ifndef SOQTTIMER_H
9#define SOQTTIMER_H
10
11#include <Inventor/sensors/SoSensor.h>
12#include <Inventor/sensors/SoSystemTimer.h>
13#include <Inventor/misc/SoRef.h>
14
15#include <QTimer>
16
20class QTVIEWERCOMPONENTS_API QtTimer : public QObject, public SoSystemTimer
21{
22 Q_OBJECT
23public:
24
26
27 virtual void start();
28
29 virtual void stop();
30
31 virtual void setDelay(int time);
32
33 virtual bool isPending() const;
34
35 virtual void setRepeat(bool flag);
36
37 virtual void setTask(SoSystemTimerTask* task);
38
39private Q_SLOTS:
40 void execCallback();
41 void onStart();
42
43Q_SIGNALS:
46
47private:
48 QTimer timer;
50 int m_delay;
51};
52
53#endif
virtual void stop()
Stop the timer.
virtual void setRepeat(bool flag)
If set to true, the timer will be triggered periodically at the rate defined by setDelay.
virtual void setTask(SoSystemTimerTask *task)
Sets the task executed when the timer is triggered.
virtual void start()
Start the timer.
void startRequired()
virtual bool isPending() const
Return true if the timer is running.
void stopRequired()
virtual void setDelay(int time)
Set the timer's timeout in milliseconds.
Smart pointer for any class inheriting SoRefCounter.
Definition SoRef.h:90
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Common interface...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Interface used b...