1 / 15

Cross-platform approach to create the interactive application based on ROOT and Qt GUI libraries

Cross-platform approach to create the interactive application based on ROOT and Qt GUI libraries. http://root.bnl.gov Rene Brun (CERN) Valeri Fine (BNL, STAR) Jerome Lauret (BNL, STAR) Fons Rademakers (CERN). Operating system “model” for HEP cross-platform applications.

karah
Télécharger la présentation

Cross-platform approach to create the interactive application based on ROOT and Qt GUI libraries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cross-platform approach to create the interactive application based on ROOT and Qt GUI libraries http://root.bnl.gov Rene Brun (CERN) Valeri Fine (BNL, STAR) Jerome Lauret (BNL, STAR) Fons Rademakers (CERN)

  2. Operating system “model” for HEP cross-platform applications It is not unusual when the life cycle of the major HEP applications last for dozens years. In other words it is much more then the life cycle of any known “system components” like operating system, file system, GUI etc. and hardware as well. To survive the sophisticated and expansive HEP applications must be in possession of some (tiny) layer to separate the HEP applications of the concrete system environment evolvement. It is possible by introducing some sort of the “virtual operating system model” the applications rely on; and providing the implementation of that model as soon as operating environment evolves. ACAT20003 fine@bnl.gov

  3. ROOT low level GUI interface ROOT (TVirtualPad) ROOT (TG<family> 3 different implementations to develop and support TVirtualX TGWIN32 TGX11 TGWin32GDK ACAT20003 fine@bnl.gov

  4. Why Qt? The present model has been serving ROOT and ROOT users very well for 8 years soon. On the other hand, most tasks to be performed and implement have no ROOT specific and have been successfully solved by other packages. • Qt package from TrollTech AS was especially attractive not only due to its superior quality and high level technical support but because it comes with the source code and tools to build it in place (including a commercial version for Windows). • The rich set of Qt documentation can be found on Web and available from the leading publishers as well. • Qt is a multi-platform C++ application framework that developers can use to write single-source applications that run-natively-on Windows, Linux, Unix, Mac OS X and embedded Linux. • Qt has been used to build thousands of successful commercial applications worldwide, • and is the basis of the open source KDE desktop environment. ACAT20003 fine@bnl.gov

  5. ROOT Qt-based GUI interface ROOT ROOT TVirtualX only one (!) implementation TGQt ACAT20003 fine@bnl.gov

  6. ROOT GUI class library and Qt layer • The above Qt layer first was present last year on Acat2002 @ Moscow and has the significant drawback. • Event though it solves the problem of combining the ROOT Canvas and Qt widgets within one single application it was not compatible with the ROOT GUI class library and the compatibility with the conventional ROOT development. ACAT20003 fine@bnl.gov

  7. TGQt TQtWidget TQtClientFilter TVirtualX QWidget QObject TQtClientWidget QFrame QWidget Transformation the QEvent Q-object into the ROOT Event_t structure TGClient::ProcessOneEvent Event_t QEvent TGQt::NextEvent() QPtrQueue<Event_t> fRootEventQueue TGQt::Init(…) TGQt::CreateWindow(…) TGQt::InitWindow(…) QWidget::installEventFilter

  8. To run ROOT Create TApplication Enter ROOT event loop TApplication::Run To run Qt Create QApplication Enter Qt event loop QApplication::exec() ROOT vs Qt This implementation: TApplication QApplication QApplication::exec() TApplication::Run() Bottom line:No need to deal with QApplication! ACAT20003 fine@bnl.gov

  9. Qt Root “Hello Word” 1. Qt “Hello Word” source file #include <qapplication.h> #include <qpushbutton.h> int main( int argc, char **argv ) { QApplication a( argc, argv );// to be replaced QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); // to be removed hello.show(); return a.exec(); // to be replaced } 2. QtROOT “Hello Word” source file #include <TRint.h> #include <qpushbutton.h> int main( int argc, char **argv ) { // Create an interactive ROOT application TRint *theApp = new TRint("Rint", &argc, argv); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); hello.show(); theApp->Run(); // and enter the event loop... } ACAT20003 fine@bnl.gov

  10. A test application to combine ROOT and Qt Widget ACAT20003 fine@bnl.gov

  11. ROOT QtGLWidget A fragment of STAR “Event Display” QtGLViewer class based viewer see: http://www.rhic.bnl.gov/~fine/EventDisplay ) ACAT20003 fine@bnl.gov

  12. GL Image formats provided by QGLViewer class ACAT20003 fine@bnl.gov

  13. Where to get Qt-ROOT from ACAT20003 fine@bnl.gov

  14. Qt-ROOT FAQ ACAT20003 fine@bnl.gov

  15. Conclusion There are enough evidences the present approach allows the ROOT developers as well as ROOT users to work with code that has no X11/WIN32 graphics subsystem dependencies and at the same time opens unrestricted access to a rich set of ready-to-use commercial and free GUI Qt-based widgets. Qt layer is provided as the standard ROOT “plug-in” share library. That allows user to turn the layer on/off at run time with no change of recompilation of the user’s code. At the moment we are testing the layer to provide the full ROOT GUI classes implementation. Information about progress can be found on BNL Web site: http://root.bnl.gov That should be completed and the full compatible version of ROOT Qt layer to be released with the regular ROOT distribution by ROOT 2004 Workshop. ACAT20003 fine@bnl.gov

More Related