GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ExampleMain.cpp
Go to the documentation of this file.
1 // $Id: ExampleMain.cpp 2982 2021-01-14 08:26:10Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TApplication.h"
15 
16 #include "QRootApplication.h"
17 
18 #include "ExampleWidget.h"
19 
20 int main(int argc, char **argv)
21 {
22 
23  argc = 1; // hide all additional parameters from ROOT and Qt
24  TApplication app("uno", &argc, argv); // ROOT application
25 
26  char* argv2[2];
27  argv2[0] = argv[0];
28  argv2[argc] = 0;
29 
30  QRootApplication myapp(argc, argv2); // Qt application
31 
32  // create instance, which should be used everywhere
33  ExampleWidget* widget = new ExampleWidget();
34 
35  myapp.connect(&myapp, SIGNAL(lastWindowClosed()), &myapp, SLOT(quit()));
36 
37  widget->show();
38 
39  int res = myapp.exec();
40  return res;
41 }
int main(int argc, char **argv)
Definition: ExampleMain.cpp:20