00001 // @(#)root/qt:$Id: TQtTimer.h 32141 2010-01-28 16:42:30Z bellenot $ 00002 // Author: Valery Fine 09/08/2004 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * 00006 * Copyright (C) 2002 by Valeri Fine. * 00007 * All rights reserved. * 00008 * * 00009 * For the licensing terms see $ROOTSYS/LICENSE. * 00010 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00011 *************************************************************************/ 00012 00013 #ifndef ROOT_TQtTimer 00014 #define ROOT_TQtTimer 00015 00016 #include "Rtypes.h" 00017 00018 #ifndef __CINT__ 00019 # include <QTimer> 00020 #else 00021 class QTimer; 00022 #endif 00023 00024 // 00025 // TQtTimer is a singelton QTimer to awake the ROOT event loop from Qt event loop 00026 // 00027 00028 //___________________________________________________________________ 00029 class TQtTimer : public QTimer { 00030 #ifndef __CINT__ 00031 Q_OBJECT 00032 #endif 00033 private: 00034 void operator=(const TQtTimer &); 00035 TQtTimer(const TQtTimer &); 00036 protected: 00037 static TQtTimer *fgQTimer; 00038 int fCounter; 00039 TQtTimer (QObject *mother=0): QTimer(mother),fCounter(0) 00040 {} 00041 00042 protected slots: 00043 virtual void AwakeRootEvent(); 00044 00045 public: 00046 virtual ~TQtTimer(){} 00047 static TQtTimer *Create(QObject *parent=0); 00048 static TQtTimer *QtTimer(); 00049 ClassDef(TQtTimer,0) // QTimer to awake the ROOT event loop from Qt event loop 00050 }; 00051 00052 00053 #endif