ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
gui
qtgsi
test
example1
qtroot.h
Go to the documentation of this file.
1
#ifndef QTROOT_H
2
#define QTROOT_H
3
4
#include "
Riostream.h
"
5
using namespace
std;
6
7
#include "qprinter.h"
8
#include "qstring.h"
9
#include "qthread.h"
10
#include "qtabwidget.h"
11
12
#if QT_VERSION >= 0x40000
13
//Added by qt3to4:
14
#include <QPaintEvent>
15
#include <QResizeEvent>
16
#include <QMouseEvent>
17
#include <QCloseEvent>
18
#include "q3mainwindow.h"
19
#else
20
#include "qmainwindow.h"
21
typedef
QMainWindow
Q3MainWindow
;
22
#endif
23
24
#include "
TObject.h
"
25
#include "
TCanvas.h
"
26
#include "
TVirtualX.h
"
27
#include "
TMethod.h
"
28
#include "
TMethodArg.h
"
29
#include "
TH1.h
"
30
#include "
TF1.h
"
31
#include "TFormula.h"
32
#include "
TPad.h
"
33
#include "
TSystem.h
"
34
35
#include "
TQRootCanvas.h
"
36
37
38
class
QPrinter;
39
class
QMouseEvent;
40
class
QResizeEvent;
41
class
QPaintEvent;
42
43
/**
44
*
45
* Main Qt&Root Application Window:
46
*
47
* Simple Example how to use a QMainWindow class
48
* embedding a ROOT Canvas attached as its Central Widget.
49
*
50
*
51
* @short Simple example using
52
* QMainWindow together with an QRootCanvas
53
*
54
*
55
* Services:
56
* Simple example
57
* @li Creates a Menu for file actions (save, browse, close, ect...)
58
* @li Creates a Toolbar with actions managed by QAction class
59
* @li Creates a QRootCanvas and stick it as central Widget in QMainWindows
60
* @li Actions ( execute(), clear()) are defined as slots managed by this
61
* QMainApplication. This slots functions acts on the ROOT Objects
62
* directly ( histograms, ntuples, ect...)
63
*
64
* @see QRootCanvas, QMainWindow, QPopupMenu, QAction, QString
65
*
66
* @authors Denis Bertini <d.bertini@gsi.de>
67
* @version 2.0
68
*
69
*/
70
71
72
class
ApplicationWindow
:
public
Q3MainWindow
73
{
74
Q_OBJECT
75
public
:
76
ApplicationWindow
();
77
~
ApplicationWindow
();
78
79
protected
:
80
void
closeEvent( QCloseEvent* ce);
81
82
protected
slots:
83
void
myclose
(){
84
close
();
85
}
86
/**
87
New incoming functionality documentation
88
*/
89
void
newDoc();
90
/**
91
IO Loading:
92
@li ascii data files (Qt or ROOT streamers)
93
@li Root binary files(ROOT streamer)
94
@ etc...
95
*/
96
97
void
load();
98
/**
99
IO Loading function:
100
101
@li ascii data files (Qt or ROOT streamers)
102
@li Root binary files(ROOT streamer)
103
@ etc...
104
*/
105
void
load(
const
char
*fileName );
106
/**
107
Saving results function:
108
109
@li ascii data files
110
@li histograms, ntuples, Objects using
111
@li ROOT based IO (Root format)
112
@li Qt Based IO (Qt format)?
113
114
@ etc...
115
*/
116
117
void
save();
118
/**
119
saving pictures, in different supported formats
120
*/
121
void
saveAs();
122
/**
123
print results in a specified format
124
*/
125
void
print();
126
/**
127
online help about Qt&Root Main Application
128
*/
129
void
about();
130
/**
131
online help about this Qt based Application
132
*/
133
void
aboutQt();
134
/**
135
Main slot action upon ROOT classes
136
@li histograms
137
@li ntuples
138
*/
139
void
execute();
140
141
/**
142
Main slot to reinitialize the objects
143
@li histograms
144
@li ntuples
145
*/
146
147
void
clear_histo();
148
void
closeQtRoot
(){
149
qDebug(
"QtRoot: closing qt wins \n"
);
150
close
();
151
qDebug(
"QtRoot: exiting root \n"
);
152
gSystem
->
Exit
(0);
153
}
154
155
private
:
156
QString
filename
;
157
QPrinter *
printer
;
158
TQRootCanvas
*aCanvas,*
aCanvas2
;
159
TH1F*
histo
;
160
TF1 *
sqroot
;
161
TFormula *
form1
;
162
TPad*
pad1
,*
pad2
;
163
QTabWidget*
tab
;
164
QWidget*
central
;
165
};
166
167
#endif
ApplicationWindow::closeQtRoot
void closeQtRoot()
Definition:
qtroot.h:148
TQRootCanvas.h
ApplicationWindow::filename
QString filename
Definition:
qtroot.h:156
ApplicationWindow::myclose
void myclose()
Definition:
qtroot.h:83
pad1
TPad * pad1
Definition:
hcons.C:13
ApplicationWindow::central
QWidget * central
Definition:
qtroot.h:164
TQRootCanvas
Definition:
TQRootCanvas.h:59
ROOT::Math::detail::close
Definition:
GenVectorIO.h:35
ApplicationWindow::aCanvas2
TQRootCanvas * aCanvas2
Definition:
qtroot.h:158
TMethod.h
ApplicationWindow::pad2
TPad * pad2
Definition:
qtroot.h:162
TSystem.h
ApplicationWindow::printer
QPrinter * printer
Definition:
qtroot.h:157
TCanvas.h
TMethodArg.h
ApplicationWindow
Main Qt&Root Application Window:
Definition:
qtroot.h:72
gSystem
R__EXTERN TSystem * gSystem
Definition:
TSystem.h:545
Q3MainWindow
QMainWindow Q3MainWindow
Definition:
qtroot.h:21
ApplicationWindow::histo
TH1F * histo
Definition:
qtroot.h:159
ApplicationWindow::tab
QTabWidget * tab
Definition:
qtroot.h:163
ApplicationWindow::form1
TFormula * form1
Definition:
qtroot.h:161
Riostream.h
TF1.h
TVirtualX.h
ApplicationWindow::sqroot
TF1 * sqroot
Definition:
qtroot.h:160
TObject.h
TSystem::Exit
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
Definition:
TSystem.cxx:720
TH1.h
TPad.h