TQUserEvent.h

Go to the documentation of this file.
00001 // @(#)root/qt:$Id: TQUserEvent.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Valeri Fine   21/01/2002
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_TQUserEvent
00014 #define ROOT_TQUserEvent
00015 
00016 #include <qglobal.h>
00017 #if QT_VERSION < 0x40000
00018   #include <qevent.h>
00019 #endif /* QT_VERSION */
00020 #include "GuiTypes.h"
00021 
00022 class TQUserEvent : public 
00023 #if QT_VERSION < 0x40000
00024    QCustomEvent 
00025 #else
00026    QEvent 
00027 #endif
00028 {
00029 #if QT_VERSION >= 0x40000
00030 private:
00031    Event_t *fEvent;
00032 #endif 
00033 public:
00034 #if QT_VERSION >= 0x40000
00035    Event_t *data() const { return fEvent;}
00036    void setData(Event_t *ev) { delete data(); fEvent=ev;}
00037    TQUserEvent(const Event_t &pData) : QEvent(Type(QEvent::User+Type(1))),
00038                    fEvent(0)
00039 #else
00040    TQUserEvent(const Event_t &pData) : QCustomEvent(Id(),0)
00041 #endif
00042    {   setData(new Event_t); *(Event_t *)data() = pData;  }
00043    ~TQUserEvent() { delete (Event_t *)data(); }
00044    void getData( Event_t &user) const { user = *(Event_t*)data(); }
00045    static Type Id() { return Type(QEvent::User + Type(1) /*kQTGClientEvent*/) ;}
00046 };
00047 
00048 #endif

Generated on Tue Jul 5 14:14:32 2011 for ROOT_528-00b_version by  doxygen 1.5.1