Questions about Qt and Root

Hi Valeri and everybody,

I would like to ask different things about Qt (my version is 4.4.1) and Root 5.22/00, I would like to develop a Qt application cross-platform that uses TEve and TCanvas objects. I know that exists QtRoot (from bnl), and the famous INSTALL_QTROOT.sh that it’s very nice for all platforms. But I would like to use Root (default version) with the qt-layer activated because I need Root’s “default/normal version” layout.

1) I configured Root using:[quote] ./configure --build=release --enable-qt --enable-table[/quote] On my linux Ubuntu 8.1, it’s great including the Qtdesigner for TQtWidget, everything works.
But I have problem with Windows (cygwin+VC++2008), when I tried . /configure etc… at the compilation’s end it cannot find libGPad.lib (see attachment 1), is there something wrong in the Makefile? To finish the compilation I only copied libGPad.lib from lib\ to $ROOTSYS, in this way the compilation finished without errors. But, obviously, there is something wrong; I cannot create any Qt application with Root. (see attachment 2). I would like to know if is there the possibility to install it on Windows, without problems :smiley: , not using QTRoot (because TEve doesn’t works in Qtroot, see attachment 3).

2) I would like to know: Why there isn’t a TQtGLViewerWidget class in Root with Qt layer activated?

3) I would like to learn how to embed a TRootEmbeddedCanvas and a TGLEmbeddedViewer on a Qt Widget and MainWindow (without using TQtWidget, etc…), where can I find information/documentation about it?

4) In a simple console application we can create a Root’s gui application (for example TGMainFrame, etc…) using TApplication class, now: is it possible to call, inside a Qt application, a class/function that uses the root’s gui? I tried to use QApplication instead of TApplication, but nothing, I found many problems during the compilation.

I hope to be clear!
So, another time, a very big thanks!!!
Cheers.






[quote=“lixo1”]1) … I would like to know if is there the possibility to install it on Windows, without problems :smiley: , not using QTRoot (because TEve doesn’t works in Qtroot, see attachment 3).
[/quote]Unfortunately, The answer is “no”. Qt-layer for Windows is NOT included :frowning: into the regular ROOT distribution. There was a decision to include only Qt-layer for X11 into CERN ROOT repository.

[quote=“lixo1”]But, obviously, there is something wrong; I cannot create any Qt application with Root[/quote]The QtRoot CVS repository from STAR/BNL contains subdirectory “qtExamples” with a bunch of the “HelloWorld” level small applications to demonstrate the different ways to combine ROOT and Qt applications. These examples can be built and work on X11 / Win32 and MacOS(Native GUI) platforms. Please try it.

[quote=“lixo1”](because TEve doesn’t works in Qtroot,[/quote]It will not work together anyway. Someone needs to do some job to make TEve work with Qt-based interface yet. STAR doesn’t use TEve, We use Coin3D and TQtGLViewerWidget. see root.cern.ch/phpBB2/viewtopic.php?t=7863. I have no ground to do this job myself. However I am willing to assist someone who wants to make it up and running.

[quote=“lixo1”]2) I would like to know: Why there isn’t a TQtGLViewerWidget class in Root with Qt layer activated?
[/quote]This class is a part of the Qt-extension rather of Qt-layer. QtRoot extension is not :frowning: included in to CERN ROOT svn repository.

[quote=“lixo1”]3) I would like to learn how to embed a TRootEmbeddedCanvas and a TGLEmbeddedViewer on a Qt Widget and MainWindow (without using TQtWidget, etc…), where can I find information/documentation about it?[/quote]I am not sure I did understand yet what you really want to achieve. It seems to me you are asking several different questions. Please, elaborate. Anyway, please look up the post root.cern.ch/phpBB2/viewtopic.php?t=7863. I am wondering if it may answer your question 3 partly.

[quote=“lixo1”]4)In a simple console application we can create a Root’s gui application (for example TGMainFrame, etc…) using TApplication class, now: is it possible to call, inside a Qt application, a class/function that uses the root’s gui?[/quote]Yes, it is possible.

[quote=“lixo1”]I tried to use QApplication instead of TApplication, but nothing, I found many problems during the compilation.[/quote]I am sorry, I am afraid I did not get what you want to achieve. What concrete problem you want to resolve. Anyway, you do not need to call QApplication. QApplication is created for you by Qt-layer. You can use Aclic as usually to create and load the shared library with Qt classes inside. I think ftp://root.cern.ch/root/doc/chapter27.pdf p. 427. The QtRoot CVS repository from STAR/BNL contains subdirectory “qtExamples” with a bunch of the “HelloWorld” level small applications to demonstrate the different ways to combine ROOT and Qt applications. I think it covers many real-life scenarios. However i have to admit I did not try some fantastic exotic combination.

May be I should clarify the scope of the project in question.

The main goal is to allow to use ROOT from Qt application. Of course, one may ask for Qt for ROOT application too. I can not say the later is harder to implement. However the later is harder to negotiate. The ground for former is clear, Qt “as it is” has no histograming , advance OO I/O, C++ interpreter, sophisticated math etc.
Qt4 is a compact few modules framework after all. doc.trolltech.com/4.4/modules.html.
ROOT is huge and powerful more than 104 packages framework. That makes the difference.

Oh Valeri,
Thank you very, very much for all explanations, you are very clear!!! Now I understand exactly what QtRoot is and why we have coin3d, etc…
So after a very big reflection (7h :open_mouth: ), I decided the way that I will work, but to do it I must have to learn how to create a Qt application that uses Root’s Gui, I tried many things but nothing. I will start on Linux with Root + qt-layer, but I have only a question.
Could you please take a look on my example (console win32) in attachment, I would like to convert it to be compatible with a Qt application, in other words, what I have to use in the main (in this case New.cpp)?

Now the main is like that:

[code]#include
#include "HRS.h"
using namespace std;

int main(){

Draw3DViewer();

return 0;

}[/code]

What I have to modify? Use TRint, QApplication, … ?
Another time thank you very much!
Cheers

Opp :blush: I’ve found I missed and did not reply your last question :open_mouth: Do you still need my assistance ? (There is no attachment anyway).

Best regards, Valeri

Now I’m using QtRoot, and it solves my problems!
Thank you Valeri.

Thank you too.
Thank Stefano Carrazza for his nice small contribution for my “HelloWord”-level Qt-Root examples to render the arbitrary ROOT TF2 objects as the result of this discussion (see root.bnl.gov/QtRoot/pictures/HelloOpenGL.png ,
attachment. The source code is available from CVS)