summaryrefslogtreecommitdiffstats
path: root/qtinterface/tqtimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtinterface/tqtimer.h')
-rw-r--r--qtinterface/tqtimer.h51
1 files changed, 25 insertions, 26 deletions
diff --git a/qtinterface/tqtimer.h b/qtinterface/tqtimer.h
index 7b6b72b..f1c1390 100644
--- a/qtinterface/tqtimer.h
+++ b/qtinterface/tqtimer.h
@@ -40,44 +40,37 @@ Boston, MA 02110-1301, USA.
// Linker tricks required to override a class without changing its name
#define QTimer IQTimer
-#include <qtimer.h>
+#include <QtCore/qtimer.h>
#undef QTimer
class QTimer : public IQTimer {
// This is taken straight from the Qt header file, with all Q_OBJECT, slot, and similar keywords stripped out.
+// Also, all inline functions must be converted to simple declarations.
// This is the last and most obnoxious part of the linker tricks mentioned above
// Essentially, the compiler needs to know that these Q functions exist so that the above I functions
// are not attempted to link. Instead, these empty declarations allow the linker to pull in the complete Q function
// from the Qt toolkit in use. Convoluted, yes, but it should make maintinance MUCH easier as the Qt API changes.
public:
- QTimer( QObject *parent=0, const char *name=0 );
- ~QTimer();
+ explicit QTimer(QObject *parent = 0);
+ ~QTimer();
- bool isActive() const;
+ inline bool isActive() const;
+ int timerId() const;
- int start( int msec, bool sshot = FALSE );
- void changeInterval( int msec );
- void stop();
+ void setInterval(int msec);
+ int interval() const;
- static void singleShot( int msec, QObject *receiver, const char *member );
+ inline void setSingleShot(bool singleShot);
+ inline bool isSingleShot() const;
- int timerId() const { return id; }
+ static void singleShot(int msec, QObject *receiver, const char *member);
- void timeout();
+ void start(int msec);
-protected:
- bool event( QEvent * );
+ void start();
+ void stop();
-private:
- int id;
- uint single : 1;
- uint nulltimer : 1;
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QTimer( const QTimer & );
- QTimer &operator=( const QTimer & );
-#endif
+ void timeout();
// End Qt header file copy
// This is where the new member functions should be placed
@@ -85,12 +78,18 @@ private: // Disabled copy constructor and operator=
// and they should usually do something. Feel free to include as many Qt files as needed
// in the cpp source file, but DO NOT include them in this header file.
int myNewFunction(int parameter_one);
+
+// Begin Qt header file copy
+protected:
+ void timerEvent(QTimerEvent *);
+
+private:
+ inline int startTimer(int);
+ inline void killTimer(int);
};
-inline bool QTimer::isActive() const
-{
- return id >= 0;
-}
+//inline void QTimer::setSingleShot(bool asingleShot) { single = asingleShot; }
+// End Qt header file copy
#endif // USE_QT4