00001 // @(#)root/qtgsi:$Id: TQRootGuiFactory.cxx 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Denis Bertini, M. Al-Turany 01/11/2000 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 00013 ////////////////////////////////////////////////////////////////////////// 00014 // // 00015 // TQRootGuiFactory // 00016 // // 00017 // This class is a factory for Qt GUI components. It overrides // 00018 // the member functions of the ABS TGuiFactory. // 00019 // // 00020 ////////////////////////////////////////////////////////////////////////// 00021 00022 #include "TQRootGuiFactory.h" 00023 #include "TRootCanvas.h" 00024 #include "TQCanvasImp.h" 00025 00026 ClassImp(TQRootGuiFactory) 00027 00028 //______________________________________________________________________________ 00029 TQRootGuiFactory::TQRootGuiFactory(const char *name, const char *title) 00030 : TRootGuiFactory(name, title) 00031 { 00032 // TQRootGuiFactory ctor. 00033 // The default implementation is not customized. 00034 // The ROOT TRootCanvas class is being used. 00035 00036 fCustom=kFALSE; 00037 00038 } 00039 //______________________________________________________________________________ 00040 TQRootGuiFactory::~TQRootGuiFactory() 00041 { 00042 //destructor 00043 } 00044 00045 //______________________________________________________________________________ 00046 TCanvasImp *TQRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, 00047 UInt_t width, UInt_t height) 00048 { 00049 // Create a ROOT native GUI version of TCanvasImp 00050 // @param TCanvas *c (ptr to ROOT TCanvas) 00051 // @param char* title (title for canvas) 00052 // @param width 00053 // @param height 00054 // @return QCanvasImp* 00055 00056 if ( fCustom ) { 00057 TQCanvasImp* cimp= new TQCanvasImp(c,title,width,height); 00058 return ( cimp ); 00059 } 00060 else { 00061 return new TRootCanvas(c, title, width, height); 00062 } 00063 } 00064 00065 //______________________________________________________________________________ 00066 TCanvasImp *TQRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, 00067 Int_t x, Int_t y, UInt_t width, UInt_t height) 00068 { 00069 // Create a ROOT native GUI version of TCanvasImp 00070 // @param TCanvas *c (ptr to ROOT TCanvas) 00071 // @param char* title (title for canvas) 00072 // @param x 00073 // @param y 00074 // @param width 00075 // @param height 00076 // @return TQCanvasImp* 00077 00078 if ( fCustom ) { 00079 TQCanvasImp* cimp= new TQCanvasImp(c,title,x,y,width,height); 00080 return cimp ; 00081 } 00082 else { 00083 return new TRootCanvas(c, title, x, y, width, height); 00084 } 00085 } 00086