QT and ROOT

I understand that Root can be used with Qt in two different ways:

  1. Using Qt-Root. In this method, we use the ROOT event loop and the QT interface that is provided by the new version of ROOT.

  2. Compiling the ROOT libraries and using them in pure QT application.

I am trying to understand the advantages/disadvantage of each approach. If I make a pure QT application, will I be losing any functionality that I would have available to me if it were a Qt-Root application.

Also, if I make a pure QT application and use the ROOT libraries, I don’t understand how to get ROOT objects such as histtograms and graphs to draw themselves. In general, I don’t understand the relationship between ROOT and the graphics subsystem. Are the objects written in ROOT such as TH1F and TGraph written in such a way that they can interface with any graphics system - such as QT. If so, can you explain how this is done?

Thanks in advance.

Jon

Hello Jon,
I am begging a pardon for delay. I was busy with our STAR collaboration meeting and did not look up Root Forum :blush:

[quote=“jon149”]I understand that Root can be used with Qt in two different ways:

  1. Using Qt-Root. In this method, we use the ROOT event loop and the QT interface that is provided by the new version of ROOT.

  2. Compiling the ROOT libraries and using them in pure QT application.

Jon[/quote]

Qt-ROOT helps you either way because it is supposed to handle events coming from both event loops.

[quote=“jon149”]
I am trying to understand the advantages/disadvantage of each approach. If I make a pure QT application, will I be losing any functionality that I would have available to me if it were a Qt-Root application.
Jon[/quote]

You should not lose any functionality of either package as soon as you

  1. Start ROOT with Qt-layer
  2. Start Qt and use TQtWidget to create the embedded canvases.

What is better for you dependes of your current environment.
If you find it is not true then it may have discovered a bug to be reported and fixed.

If you already have gotten a Qt application and want to add there some Root TCanvas then you should use the second way.

If your application is a ROOT application that you decide to enchance with some Qt GUI then you should have adopted the frist approach.

[quote=“jon149”]
Also, if I make a pure QT application and use the ROOT libraries, I don’t understand how to get ROOT objects such as histtograms and graphs to draw themselves.
Jon[/quote]

I think the best way to learn thing is to start with some working example.
See: root.bnl.gov/QtRoot/QtRoot.html#designer

I would advice to download the “Simple histogram browser”.
It is 60 lines long C++ code that I believe one can understand (If it is not let me know. I’ll improve it)

[quote=“jon149”]
In general, I don’t understand the relationship between ROOT and the graphics subsystem. Are the objects written in ROOT such as TH1F and TGraph written in such a way that they can interface with any graphics system - such as QT. If so, can you explain how this is done?
Jon[/quote]

Please look up the list of the publications
see: root.bnl.gov/QtRoot/QtRoot.html#publications

If you still have some question dont’ hesistate forwarding me that. We are at the very begining of the qt package life-cycle and I do keen to hear the user’s opinion.