Clickable ROOT histograms in QT

I should add, that not only does nothing show up in the frame, which does popup, but I get the error:

Warning in TCanvas::ResizePad qrootCanvas width changed from 0 to 10
Warning in TCanvas::ResizePad qrootCanvas height changed from 0 to 10

I though this might help. I think this means that the canvas size is not be set properly or something, so it could be that my histogram is being added to the canvas and being displayed, but the canvas isn’t setup correctly so I just can’t see it.

Thanks,
Taylor

I know that the Atlas folks decided to use Qt a long time ago, despite our many warnings!!
You do not need Qt with ROOT. All what you want to do works perfectly without Qt.
You load much less code in memory and the graphics and GUI is well debugged.

In addition you are facing the infamous changes from Qt3 to Qt4 (and just wait Qt5 ::).
All Atlas GUIs that I have seen so far are totatlly trivial to do with the ROOt GUI and you will spend much less time in making your conversion now than facing the multiple problems with the Qt interface and the changes of version.

This is just one more warning ::slight_smile:

Rene

Seeing as I took no part in making those decisions I can’t comment on previous choices, but when you decide to use a certain piece of software you should also be required to keep it up to date for the users sake. :confused:

[quote=“brun”]I know that the Atlas folks decided to use Qt a long time ago, despite our many warnings!!
You do not need Qt with ROOT. All what you want to do works perfectly without Qt.
You load much less code in memory and the graphics and GUI is well debugged.

In addition you are facing the infamous changes from Qt3 to Qt4 (and just wait Qt5 ::).[/quote]Can you back your words with some concrete numbers?
Mean time I can share mine.
Switching from Qt3 libraries to Qt4 libraries for STAR Online Monitoring took me 2 man-days.
Switching from ROOT 5.12 (it is our “pro” version for last 3 years) to ROOT 5.22 (it is STAR current “dev” version) took STAR one year.

[quote=“brun”]All Atlas GUIs that I have seen so far are totatlly trivial to do with the ROOt GUI[/quote]That means ATLAS did a good job with its GUI design. The good useful GUI must be TRIVIAL. (check the google.com home page )
The main motto of Qt is embedded into the Qt logo doc.qtsoftware.com “Code Less, Create more”.
Rene, are you saying Qt “Code Less, Create more” is not correct?

[quote=“brun”] and you will spend much less time in making your conversion now than facing the multiple problems with the Qt interface and the changes of version.[/quote] Again, I think it would extremely useful for both ROOT and Qt users to get the concrete list of the problems to allocate the correct man-power.
Rene, please do not keep it as a secret, publish that list.

It would be very useful to know how long it took ATLAS to switch from Qt3 to Qt4 and why they did it? What kind of manpower was involved.
Again, let me share the STAR experience ( may be the other people can share their experience too ) . Many ONLINE applications were written many years ago with Qt3 and they remain on Qt3. Nobody touches it, nobody finds any reason to spend the man-power converting the working applications. They work and people do not care whether it is ROOT / Qt3 / Qt4 inside.

[quote=“jtchil0”]OK, another clarification to my situation.

I tried essentially doing what you did with the TQtWidget, but instead just using the TQRootCanvas class. Is this not a good method? [/quote]it is the wrong method. This is the internal class the end user code should not be aware about.[quote=“jtchil0”]Perhaps I need to do something else.
Can you guide me to the correct method?
[/quote]Yes, I 'll.

[quote=“jtchil0”]From what I can tell they have recompiled your QTROOT classes (from ROOT v5.18 or less) with the ATLAS online software (which is using ROOT v5.22) so they can continue using QT3. [/quote]Yes, this is correct.
Since CERN dropped Qt3/Root support one year ago I propose to discuss this issue further via friendly QtRoot list lists.bnl.gov/pipermail/qt-root-l/

[quote=“brun”] . . . This is just one more warning ::slight_smile:
[/quote]To be concrete, let’s re-read this thread to see what kind of the problem people have to spend time for debugging their “Qt” applications: root.cern.ch/phpBB2/viewtopic.ph … ght=#37957
From my stand point they are not Qt3 / Qt4 / Qt" related.

[quote=“jtchil0”] However, they have not included the TQtWidget in their list of classes.[/quote] It is not possible. TQtWidget is the crucial component (like TObject )

ls /afs/cern.ch/sw/lcg/external/root/5.18.00*/slc4_ia32_gcc34/root/include/TQtWidget.h /afs/cern.ch/sw/lcg/external/root/5.18.00a/slc4_ia32_gcc34/root/include/TQtWidget.h /afs/cern.ch/sw/lcg/external/root/5.18.00d/slc4_ia32_gcc34/root/include/TQtWidget.h /afs/cern.ch/sw/lcg/external/root/5.18.00e/slc4_ia32_gcc34/root/include/TQtWidget.h /afs/cern.ch/sw/lcg/external/root/5.18.00f/slc4_ia32_gcc34/root/include/TQtWidget.h /afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/include/TQtWidget.hTo do

[quote=“jtchil0”]they have recompiled your QTROOT classes (from ROOT v5.18 or less) with the ATLAS online software [/quote]one needs TQtWidget.h around period.

[quote=“jtchil0”] Can you guide me to the correct method?[/quote] Just add #include "TQtWidget.h" into your code. Did you try that ? Can you show me the compilation log? It seems to me your problem coming from the mixed Qt3/Qt4 env. This is a source of 96% of the reported QtRoot problem.

[quote=“jtchil0”]TFile file(“file.root”,“READ”);
TList* list = file.GetListOfKeys();
TKey* key = (TKey*)list->At(0);

TH2S* temp= (TH2S*)key->ReadObj();

histogram = new TH2S(*temp);
histogram->SetDirectory(0);
[/quote]I think your approach is error prone. I would advise:TFile file("file.root"); TList* list = file.GetListOfKeys(); TKey* key = (TKey*)list->At(0); if (histogram ) delete histogram; // One may need some extra clean up elsewhere too. // One needs to see your code to be concrete TString className = key->GetClassName(); if (className == "TH2S") { // Read TH2S objects only, skip all others histogram = (TH2S *)key->ReadObj(); histogram->SetDirectory(0); }

[quote]Can you back your words with some concrete numbers?
[/quote]
yes, of course with great pleasure. Adding the Qt libraries to a ROOT executable
adds something like 38 MBytes of shared lib, decomposed as follows, eg on lxplus

4059800 libGQt.so => /afs/cern.ch/user/b/brun/w0/rootslc4amd64/root/lib/libGQt.so (0x0000002a95ecc000) 2518624 libQtCore.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtCore.so.4 (0x0000002a96077000) 10862728 libQtGui.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtGui.so.4 (0x0000002a963de000) 3466976 libQt3Support.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQt3Support.so.4 (0x0000002a96f38000) 556560 libQtOpenGL.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtOpenGL.so.4 (0x0000002a97385000) 403448 libQtSvg.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtSvg.so.4 (0x0000002a9750e000) 336888 libQtXml.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtXml.so.4 (0x0000002a97670000) 15082080 libQtWebKit.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtWebKit.so.4 (0x0000002a977c2000) 1235416 libQtNetwork.so.4 => /afs/cern.ch/sw/lcg/external/qt/4.4.2/slc4_amd64_gcc34/lib/libQtNetwork.so.4 (0x0000002a98726000)
At a time where Atlas is fighting to gain memory as much as possible, this is clearly a big loss.

[quote]Switching from Qt3 libraries to Qt4 libraries for STAR Online Monitoring took me 2 man-days.
Switching from ROOT 5.12 (it is our “pro” version for last 3 years) to ROOT 5.22 (it is STAR current “dev” version) took STAR one year.
[/quote]
From what I know, you are working since more than 2 years making infinite changes to go from Qt3 to Qt4. These changes are reflected in the ROOT SVN logs fro your forward compatible changes to backward compatible changes, to elimination of the qt3 interface. And I believe that this work is not yet finished.
Concerning the move from ROOT5.12 to 5.22, it is hard to comment. I know that larger experiments have been able to convert in much shorter time scales. It would be interesting to know why it took so much time for STAR.

[quote]The main motto of Qt is embedded into the Qt logo doc.qtsoftware.com “Code Less, Create more”.
Rene, are you saying Qt “Code Less, Create more” is not correct?
[/quote]
Hum! from what I see on this forum, I would say “Code more and get pain”.
I repeat the Qt interface in ROOT is not required. The ROOT standard graphics produces better results and in a reliable way.

[quote]Again, I think it would extremely useful for both ROOT and Qt users to get the concrete list of the problems to allocate the correct man-power.
Rene, please do not keep it as a secret, publish that list.
[/quote]This list is quite simple. We have one person (Olivier) working on the development of the graphics system and another person (Bertrand) working (among other things) on the GUI and its applications. Note that the work done by Olivier and Bertrand is also essential for people using the Qt interface.
You are the person supporting/developing the Qt interface since 10 years.

Atlas did not switch to Qt4. They are still stuck with Qt3. And, I believe that
the same is true for CMS.

Rene

Hello Rene,
Thank you very much.
I understand you have no list of technical problem within the QtRoot C++ implementation I need to fix ASAP and those the QtRoot users should be aware about.
As I said many times I did QtRoot for STAR and share my experience and offer some portion of my spare time to support experiments outside of the STAR collaboration. I believe I am free to spend my free time Am not I?

Only one comment about your “ incorrect” remark.

[quote=“brun”]You are the person supporting/developing the Qt interface since 10 years.[/quote]This suggests that I claimed some credit for one’ job. It was not me it was Masa Goto.
He did create, report and publish Qt-Cint interface in 1999 alone. I had nothing to do with that implementation and Qt at the time. It is still available from ROOT svn. [quote=“brun”] work done by Olivier and Bertrand is also essential for people using the Qt interface[/quote] Anybody disagree? :open_mouth:
They provide the REAL :bulb: ROOT functionality. QtRoot provides just an interface to allow people using what ROOT team do within Qt-application too
(replacing Qwt for example)
What is wrong with using the embedded ROOT/TCanvas within Qt-applications? Why are you against ?

[quote=“brun”]Atlas did not switch to Qt4. They are still stuck with Qt3. And, I believe that the same is true for CMS.
[/quote]Are you saying there is no Qt4 user at LHC? Strange, why did you decide to drop Qt3 support in favor of Qt4 ? The job is not trivial. However, the job is finite. It can be done rather quickly. Do they need any help?
Can you tell me whom I should communicate with to learn more about their troubles?

Valeri,

Uhm! answering your mails becomes a real job because you are answering like a wall.

I have explained here many times that the Qt interface is becoming a pain.
-Only a very very very tiny fraction of ROOT users use it
-this tiny fraction faces more problems than the other fraction
-the move from Qt3 to Qt4 has been a real pain and this job is not terminated.
-it is not up to me to explain why people are still using the obsolete Qt3.
well! probably because they have realized that it was a real pain to move to Qt4.
-People (in Atlas in particular) have been adviced to use Qt for the GUI by
some gurus who have kindly disappear meanwhile. These people will suffer more
and more in the coming years. They have been warned!
-we have seen in the past (with GKS, PHIGS, then MOTIF) that all these systems
have been forced by some gurus. The gurus have disappear (probably because
of their wrong advices) and the products have disappear too.

On the other hand, we all agree that you did a good job in providing this interface.
My remarks have nothing to do with the quality of your work.
It is simply my duty to tell users that we do not invest time in the support
of the Qt interface(s) and we prefer to invest our efforts in the development
of algorithms requested by many users, to make sure that what we are supporting
is welldone on all platforms, to make it more robust and usable across many
years.

Rene

[quote=“brun”]On the other hand, we all agree that you did a good job in providing this interface.
My remarks have nothing to do with the quality of your work.
[/quote]Thank you. I do appreciate it.