ROOT  6.06/09
Reference Guide
TQRootGuiFactory.cxx
Go to the documentation of this file.
1 // @(#)root/qtgsi:$Id$
2 // Author: Denis Bertini, M. Al-Turany 01/11/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 //////////////////////////////////////////////////////////////////////////
14 // //
15 // TQRootGuiFactory //
16 // //
17 // This class is a factory for Qt GUI components. It overrides //
18 // the member functions of the ABS TGuiFactory. //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "TQRootGuiFactory.h"
23 #include "TRootCanvas.h"
24 #include "TQCanvasImp.h"
25 
27 
28 ////////////////////////////////////////////////////////////////////////////////
29 /// TQRootGuiFactory ctor.
30 /// The default implementation is not customized.
31 /// The ROOT TRootCanvas class is being used.
32 
33 TQRootGuiFactory::TQRootGuiFactory(const char *name, const char *title)
34  : TRootGuiFactory(name, title)
35 {
36  fCustom=kFALSE;
37 
38 }
39 ////////////////////////////////////////////////////////////////////////////////
40 ///destructor
41 
43 {
44 }
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Create a ROOT native GUI version of TCanvasImp
48 /// @param TCanvas *c (ptr to ROOT TCanvas)
49 /// @param char* title (title for canvas)
50 /// @param width
51 /// @param height
52 /// @return QCanvasImp*
53 
55  UInt_t width, UInt_t height)
56 {
57  if ( fCustom ) {
58  TQCanvasImp* cimp= new TQCanvasImp(c,title,width,height);
59  return ( cimp );
60  }
61  else {
62  return new TRootCanvas(c, title, width, height);
63  }
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Create a ROOT native GUI version of TCanvasImp
68 /// @param TCanvas *c (ptr to ROOT TCanvas)
69 /// @param char* title (title for canvas)
70 /// @param x
71 /// @param y
72 /// @param width
73 /// @param height
74 /// @return TQCanvasImp*
75 
77  Int_t x, Int_t y, UInt_t width, UInt_t height)
78 {
79  if ( fCustom ) {
80  TQCanvasImp* cimp= new TQCanvasImp(c,title,x,y,width,height);
81  return cimp ;
82  }
83  else {
84  return new TRootCanvas(c, title, x, y, width, height);
85  }
86 }
87 
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area)...
Definition: TCanvasImp.h:32
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: Rtypes.h:92
TCanvasImp * CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
Create a ROOT native GUI version of TCanvasImp.
virtual ~TQRootGuiFactory()
destructor
Double_t x[n]
Definition: legend1.C:17
ClassImp(TQRootGuiFactory) TQRootGuiFactory
TQRootGuiFactory ctor.
unsigned int UInt_t
Definition: RtypesCore.h:42
The Canvas class.
Definition: TCanvas.h:48
Double_t y[n]
Definition: legend1.C:17
#define name(a, b)
Definition: linkTestLib0.cpp:5