main.cpp

Go to the documentation of this file.
00001 /**
00002 *  Main program 
00003 *
00004 *  Initialising both Root/Qt environement    
00005 *
00006 *  Updated 10/10/01 
00007 *  @authors Denis Bertini <d.bertini@gsi.de> 
00008 *  @version 2.3
00009 */
00010 
00011 #include "guitest.h"
00012 #include "qtroot.h"
00013 
00014 #include "TBrowser.h"
00015 
00016 #include "TQRootApplication.h"
00017 #include "TQApplication.h"
00018 #include "qapplication.h"
00019 
00020 #include "stdlib.h"
00021 
00022 int main( int argc, char **argv )
00023 {
00024    // This is just a example of a main program using
00025    // the QtROOT interface. Here above a variable "mode"
00026    // defines different programs .ie.
00027    // mode 0 : Qtroot alone
00028    // mode 1 QtROOT + TBrowser
00029    // mode 2 QtROOT + TBrowser + Guitest (ROOT GUI"S examples)
00030 
00031    int mode = 0;
00032 
00033    TQApplication app("uno",&argc,argv);
00034 
00035    // Define a QRootApplication with polling mechanism on.
00036    // The ROOT events are then enabled .ie. the use of
00037    // TTimer TThread and Gui classes TGxx together
00038    // with Qt events handling is possible.
00039 
00040    TQRootApplication a( argc, argv, 0);
00041 
00042    // Define a QRootApplication without polling mechanism.
00043 
00044    //> QRootApplication a( argc, argv, 1);
00045    //> with debug info
00046    //> a.setDebugOn();
00047 
00048    if (argc>1 )  mode = atoi(argv[1]);
00049 
00050    // if no polling done, the user need to create a
00051    // Qt customized factory
00052    // app.setCustomized();
00053 
00054    if ( mode > 1 )
00055       TestMainFrame* mainWindow = new TestMainFrame( gClient->GetRoot(), 400, 220);
00056 
00057    if ( mode > 0  )
00058       TBrowser *b = new TBrowser();
00059 
00060    ApplicationWindow * mw = new ApplicationWindow();
00061    mw->setCaption( "Qt & ROOT" );
00062    mw->show();
00063 
00064    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
00065 
00066    int res = a.exec();
00067    return res;
00068 }

Generated on Tue Jul 5 14:22:21 2011 for ROOT_528-00b_version by  doxygen 1.5.1