Logo ROOT   6.10/09
Reference Guide
TQRootDialog.h
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 #ifndef ROOT_TQRootDialog
13 #define ROOT_TQRootDialog
14 
15 ////////////////////////////////////////////////////////////////////////////
16 //
17 // TQRootDialog
18 //
19 // A TQRootDialog is used to prompt for the arguments of an object's
20 // member function. It is called by the TQCanvasMenu class
21 // @see TQCanvasMenu, QList, QVBox, TMethod, TCanvas
22 // @authors Denis Bertini <d.bertini@gsi.de>
23 // M. AL-Turany <m.al-turany@gsi.de>
24 ////////////////////////////////////////////////////////////////////////////
25 
26 #ifndef __CINT__
27 # include "qlineedit.h"
28 # include "qnamespace.h"
29 # if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
30 # include "qlist.h"
31 # include "q3vbox.h"
32 typedef Q3VBox QVBox;
33 # else
34 # include "qvbox.h"
35 # endif
36 #endif
37 
38 #include "TObject.h"
39 
40 class TMethod;
41 class TCanvas;
42 
43 class QCloseEvent;
44 class QLineEdit;
45 class QWidget;
46 #ifdef __CINT__
47 template <typename T> class QList;
48 class QLineEdit;
49 class QList<QLineEdit*>;
50 class QVBox;
51 #if QTVERS > 3
52 class WindowFlags;
53 typedef WindowFlags Qt::WFlags;
54 #endif
55 #endif
56 
57 class TQRootDialog: public QVBox
58 {
59 #ifndef __CINT__
60  Q_OBJECT
61 #endif
62 private:
63  TQRootDialog(const TQRootDialog &);
65 
66 public:
67  TQRootDialog(QWidget *parent, const char *name, Qt::WFlags f=0,
68  TObject *obj=0,TMethod *meth=0);
69  virtual ~TQRootDialog();
70  void Add(const char* argname, const char* value, const char* type);
71  void Popup();
72  void SetTCanvas(TCanvas* aCanvas){fCurCanvas=aCanvas;}
73 
74 public slots:
75  void Receive(){ExecuteMethod();} // to be replaced
76  void ExecuteMethod();
77 
78 protected:
79  void closeEvent( QCloseEvent* ce);
80  QVBox *fArgBox; // Box layout
81  QLineEdit *fLineEdit; // LineEdit widget for arguments
82  TObject *fCurObj; // Selected object
83  TMethod *fCurMethod; // method to be executed
84  TCanvas* fCurCanvas; // current canvas
85  QWidget* fParent; // parent widget
86 # if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
87  QList<QLineEdit*> fList; // list of widget corresponding to the number of arguments
88 #else
89  QList<QLineEdit> fList; // list of widget corresponding to the number of arguments
90 #endif
91  ClassDef(TQRootDialog,1) //prompt for the arguments of an object's member function
92 };
93 
94 #endif
TQRootDialog & operator=(const TQRootDialog &)
QList< QLineEdit > fList
Definition: TQRootDialog.h:89
void SetTCanvas(TCanvas *aCanvas)
Definition: TQRootDialog.h:72
TCanvas * fCurCanvas
Definition: TQRootDialog.h:84
void Add(const char *argname, const char *value, const char *type)
Add widgets for arguments.
void closeEvent(QCloseEvent *ce)
Handle close event.
#define ClassDef(name, id)
Definition: Rtypes.h:297
QLineEdit * fLineEdit
Definition: TQRootDialog.h:81
TQRootDialog(const TQRootDialog &)
TObject * fCurObj
Definition: TQRootDialog.h:82
QVBox * fArgBox
Definition: TQRootDialog.h:80
virtual ~TQRootDialog()
dtor
TMethod * fCurMethod
Definition: TQRootDialog.h:83
QWidget * fParent
Definition: TQRootDialog.h:85
The Canvas class.
Definition: TCanvas.h:31
double f(double x)
int type
Definition: TGX11.cxx:120
Mother of all ROOT objects.
Definition: TObject.h:37
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
void Popup()
Show the dialog.
void Receive()
Definition: TQRootDialog.h:75
void ExecuteMethod()
Execute ROOT methods.