Use GUI with QT

Dear ROOTers,
due to the need for some kind of “fancy” GUI look&feel 8) , I would like to try to transform a program that has a GUI completely built with ROOT (TGMainFrame, Connect(…), TApplication::Run, etc etc) into a program that uses QT.

Is it possible? Should I re-write the whole GUI stuff (I hope no…)
If someone has some ideas/manuals/web pages to look at it would be nice

Thank you
Luigi

I am not a ROOT-GUI expert, but before switching to Qt you should, may be, ask the ROOT-GUI experts what you think cannot be done with ROOT-GUI which Qt provides.

Hi Luigi,

You may run your code using the Qt BNL layer of ROOT. For more details see the pages 415-416 at ftp://root.cern.ch/root/doc/chapter27.pdf. I am not sure will this layer allow you to use the “fancy” Qt features you are looking for and I hope the Qt experts will answer your question.

Cheers, Ilka

[quote=“luigi”]Dear ROOTers,
due to the need for some kind of “fancy” GUI look&feel 8) , I would like to try to transform a program that has a GUI completely built with ROOT (TGMainFrame, Connect(…), TApplication::Run, etc etc) into a program that uses QT.

Is it possible? If someone has some ideas/manuals/web pages to look at it would be nice[/quote]1. Yes. You can keep the ROOT GUI classes. They should work within Qt-based application,[quote=“luigi”]Should I re-write the whole GUI stuff (I hope no…)[/quote]
Yes, you should :frowning:
2. :unamused: the mixing two different GUI components is a ticking bomb and you are advised to switch to Qt GUI completely otherwise it is not clear why you want Qt. and [quote=“luigi”]due to the need for some kind of “fancy” GUI look&feel[/quote] the look and feel of your ROOT GUI classes even within Qt application will remain :open_mouth: ROOT GUI look and feel (i.e. Windows 95) [quote=“luigi”]If someone has some ideas/manuals/web pages to look at it would be nice[/quote]3. So far I have not faced any ROOT GUI based code that I could not convert to the working Qt code for 2-3 days. I can provide the further details if needed.

If you need the small real life examples I would advice you to compare some classes from the root/ged vs QtRoot/qtged packages.

You may look up the more complex one by comparing the RootShower and QtRootShower. The later is the “converted” Qt version of the ROOT-GUI-based original.
Those should allow you to estimate the scope of the ROOT-GUI - Qt-GUI transition.
To provide you more concrete advice / assistance /solution I need to see your current code :wink:

If you have further the QtRoot related questions you can use the QtRoot mail list lists.bnl.gov/mailman/listinfo/qt-root-l

Dear all,
thank you for the replies!
To clarify my point: my purpose would be to just change the look of an existing program (that already suits my computational needs :unamused: ) into a more “modern” one… For example, since some users like the max OSX interface (with all the fancy buttons, colors etc etc), I thought that QT (I have seen somewhere the “aqua” configuration option :smiley: ) could provide the needed eyecandy.

Is it correct? Anyway I will try to make the tests suggested by Valery…

Bye
Luigi

The “look and feel” of the Qt GUI is defined at run time by your Qt installation. To get this effect your application should use very Qt Gui classes rather one from ROOT GUI. ROOT GUI C++ classes are designed to provide one single “ROOT look and feel” for all platforms.

What about “aqua”.

It seems to me Qt provides this option for MacOS only and :exclamation: if you install Qt against of the Mac native GUI rather against of X11 interface.
Read carefully doc.trolltech.com/4.3/qmacstyle.html

(The same can be said about Windows XP and Windows Vista “look and feel”. Qt does not provide neither Windows XP nor Vista “look and feel” on X11 platforms.
see: doc.trolltech.com/4.3/qstyle.html#details
May be I should mention the “Vista” “look and feel” is provided by the latest release of Qt 4.2 and Qt 4.3 only doc.trolltech.com/4.3/index.html
On the other hand one always can design and deploy his / her own custom style :wink:
doc.trolltech.com/4.3/qstyle.htm … stom-style