TQtClientGuard.h

Go to the documentation of this file.
00001 #ifndef ROOT_TQtClientGuard
00002 #define ROOT_TQtClientGuard
00003  
00004 // @(#)root/qt:$Id: TQtClientGuard.h 23343 2008-04-21 04:44:58Z brun $
00005 // Author: Valeri Fine   21/01/2002
00006 
00007 /*************************************************************************
00008  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00009  * Copyright (C) 2002 by Valeri Fine.                                    *
00010  * All rights reserved.                                                  *
00011  *                                                                       *
00012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00014  *************************************************************************/
00015 
00016 #include <qobject.h>
00017 #include <qpixmap.h>
00018 #if QT_VERSION < 0x40000
00019 #  include <qptrlist.h> 
00020 #else /* QT_VERSION */
00021 #  include <QList> 
00022 #endif /* QT_VERSION */
00023 #include "TQtClientWidget.h"
00024 
00025 
00026 class TQtClientGuard : public QObject {
00027    Q_OBJECT
00028 private:
00029    TQtClientGuard& operator=(const TQtClientGuard&); // AXEL: intentionally not implementedprotected:
00030 #if QT_VERSION < 0x40000
00031    mutable QPtrList<QWidget> fQClientGuard;
00032 #else /* QT_VERSION */
00033    mutable QList<QWidget *> fQClientGuard;
00034 #endif /* QT_VERSION */
00035    int  fDeadCounter;
00036    friend class TQtClientWidget;
00037 public:
00038    TQtClientGuard(): QObject(), fDeadCounter(0){};
00039    virtual ~TQtClientGuard(){;}
00040    TQtClientWidget *Create(QWidget* parent=0, const char* name=0, Qt::WFlags f=0 );
00041    void    Delete(QWidget *w);
00042    QWidget *Find(Window_t id);
00043    void    Add(QWidget *w);
00044 
00045 protected:
00046    void    Disconnect(QWidget *w, int found=-1);
00047    void    DisconnectChildren(TQtClientWidget *w);
00048 protected slots:
00049    void    Disconnect();
00050 };
00051 
00052 class TQtPixmapGuard : public QObject {
00053    Q_OBJECT
00054 private:
00055    TQtPixmapGuard& operator=(const TQtPixmapGuard&); // AXEL: intentionally not implementedprotected:
00056 #if QT_VERSION < 0x40000
00057    mutable QPtrList<QPixmap> fQClientGuard;
00058 #else /* QT_VERSION */
00059    mutable QList<QPixmap *> fQClientGuard;
00060 #endif /* QT_VERSION */
00061    int  fDeadCounter;
00062    int  fLastFound;
00063 
00064 public:
00065    TQtPixmapGuard(): QObject(),fDeadCounter(0),fLastFound(-1){};
00066    virtual ~TQtPixmapGuard(){;}
00067    QPixmap* Create(int w, int h, int depth = -1);
00068       //Optimization optimization=DefaultOptim);
00069    QPixmap* Create (const QString &fileName, const char *format = 0);
00070    QPixmap* Create(int w, int h, const uchar *bits, bool isXbitmap=TRUE);
00071    QPixmap* Create(const QPixmap &src);
00072    QBitmap* Create(const QBitmap &src);
00073    //, ColorMode mode = Auto);
00074    QPixmap* Create ( const char* xpm[]);
00075    void    Delete(QPixmap *w);
00076    QPixmap *Pixmap(Pixmap_t id,bool needBitmap=kFALSE);
00077    QPixmap *Find(Window_t id);
00078    void    Add(QPixmap *w);
00079 
00080 protected:
00081    void    Disconnect(QPixmap *w, int found=-1);
00082    void    SetCurrent(int found) { fLastFound = found;}
00083 protected slots:
00084    void    Disconnect();
00085 };
00086 
00087 #endif
00088 

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