ROOT
6.08/07
Reference Guide
gui
qtgsi
test
example1
main.cpp
Go to the documentation of this file.
1
/**
2
* Main program
3
*
4
* Initialising both Root/Qt environment
5
*
6
* Updated 10/10/01
7
* @authors Denis Bertini <d.bertini@gsi.de>
8
* @version 2.3
9
*/
10
11
#include "
guitest.h
"
12
#include "
qtroot.h
"
13
14
#include "
TBrowser.h
"
15
16
#include "
TQRootApplication.h
"
17
#include "
TQApplication.h
"
18
#include "qapplication.h"
19
20
#include "stdlib.h"
21
22
int
main
(
int
argc,
char
**argv )
23
{
24
// This is just a example of a main program using
25
// the QtROOT interface. Here above a variable "mode"
26
// defines different programs .ie.
27
// mode 0 : Qtroot alone
28
// mode 1 QtROOT + TBrowser
29
// mode 2 QtROOT + TBrowser + Guitest (ROOT GUI"S examples)
30
31
int
mode = 0;
32
33
TQApplication
app(
"uno"
,&argc,argv);
34
35
// Define a QRootApplication with polling mechanism on.
36
// The ROOT events are then enabled .ie. the use of
37
// TTimer TThread and Gui classes TGxx together
38
// with Qt events handling is possible.
39
40
TQRootApplication
a
( argc, argv, 0);
41
42
// Define a QRootApplication without polling mechanism.
43
44
//> QRootApplication a( argc, argv, 1);
45
//> with debug info
46
//> a.setDebugOn();
47
48
if
(argc>1 ) mode = atoi(argv[1]);
49
50
// if no polling done, the user need to create a
51
// Qt customized factory
52
// app.setCustomized();
53
54
if
( mode > 1 )
55
TestMainFrame
* mainWindow =
new
TestMainFrame
(
gClient
->GetRoot(), 400, 220);
56
57
if
( mode > 0 )
58
TBrowser
*
b
=
new
TBrowser
();
59
60
ApplicationWindow
* mw =
new
ApplicationWindow
();
61
mw->setCaption(
"Qt & ROOT"
);
62
mw->show();
63
64
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
65
66
int
res = a.exec();
67
return
res;
68
}
TestMainFrame
Definition:
guitest.h:96
TBrowser.h
qtroot.h
TQRootApplication
Definition:
TQRootApplication.h:39
gClient
#define gClient
Definition:
TGClient.h:174
guitest.h
a
TArc * a
Definition:
textangle.C:12
TQApplication.h
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition:
TBrowser.h:41
ApplicationWindow
Main Qt&Root Application Window:
Definition:
qtroot.h:72
TQApplication
Definition:
TQApplication.h:30
main
int main(int argc, char **argv)
Main program.
Definition:
main.cpp:22
b
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition:
TRolke.cxx:630
TQRootApplication.h