RE: [ROOT] Re: CINT and QT

From: Faine, Valeri (fine@bnl.gov)
Date: Sat Dec 28 2002 - 17:58:09 MET


Hello Joachim,
 
I agree 
 
>  . . . integrating trolltech's qt in CINT? This could make
>  a fine GUI development/scripting environment, wouldn't it?
 
However the way you suggested to make this up looks complicated.
If I understand you properly what you want is a possibility to create 
Qt object from the Cint command prompt or ROOT macros.
 
I think this task is not trivial because the Qt header files are too
special. 
They contain the Qt-invented keywords those the TrollTech "moc" utility 
can handle properly. 
To parse it CINT has to be aware about "public/protected/public
slots/signals"
 and treat properly the special Qt macro Q_OBJECT. 
(This is a Qt equivalent of the ROOT ClassDef cpp macro). 
(see: http://doc.trolltech.com/3.0/signalsandslots.html
<http://doc.trolltech.com/3.0/signalsandslots.html>  ) and Qt-meta
object system
http://doc.trolltech.com/3.1/metaobjects.html
<http://doc.trolltech.com/3.1/metaobjects.html>  
 
Another obstacle is the Qt "event loop" that the "plain" CINT  (Cint
with no ROOT) lacks of.
 
On other hand I see no problem with loading the ROOT/Cint share
libraries into Qt scripting environment 
( http://www.trolltech.com/company/announce.html?Action=Show
<http://www.trolltech.com/company/announce.html?Action=Show&AID=116>
&AID=116 )
and calling TApplication::ProcessLine (in other words using Cint) from
there. 
 
A simple class:
 
class RootAction : public QObject {
Q_OBJECT
public slots:
  Void ProcessLine(const QString &command){
gApplication->ProcessLine(command);}
}
 
can do the job.
 
For example one can connect QLineEdit::textChanged signal
http://doc.trolltech.com/3.0/qlineedit.html#textChanged
<http://doc.trolltech.com/3.0/qlineedit.html#textChanged>  
 with RootAction::ProcessLine slot as follow:
 
void connectQt2Root(QLineEdit *line,TApplication *processor) {
  QObject::connect(line,SIGNAL(textChanged( QString&)),processor,
SLOT(ProcessLine(QString&)));
}
 
As result whatever you type from QWidget is to be passed to Cint to be
executed.
 
One can find several advanced examples in the Qt-based ROOT
implementation 
(see:   http://root.bnl.gov <http://root.bnl.gov/>    ) also.
 
I'd like to call your attention the above-mentioned Cint problem namely
lacking of the event loop 
is becoming its advantage. Now it is trivial to load Cint (with no ROOT)
into the Qt scripting environment.
 
On other hand Qt-based application has its own Qt-dictionary. 
(see again http://doc.trolltech.com/3.1/metaobjects.html
<http://doc.trolltech.com/3.1/metaobjects.html>  ) 
One can image a two steps schema:
1.      a QT dictionary generator - moc  is to be applied 
2.      Some Cint-based utility to generate a Cint dictionary from
Qt-dictionary is called
 
It is just an idea. I don't know whether it is a viable solution though.
 
Of course everything is possible. However there is an usual question 
who will pay for such sort of the integration.
As far as I know. by now the RootCint project has been driven mostly 
by "High Energy Physics" needs.
 
So far there was no volunteer even to help to complete the existent
Root/Qt integration project
(See: http://root.bnl.gov/QtRoot/QtRoot.html#tguiclass
<http://root.bnl.gov/QtRoot/QtRoot.html#tguiclass>  )
 
 
              Hope this helps, Valeri
 
 
 
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch] On Behalf Of Masaharu Goto
Sent: Friday, December 27, 2002 6:15 AM
To: Giaco777; MXJ02154@niftyserve.or.jp
Cc: cint@pcroot.cern.ch; roottalk@pcroot.cern.ch
Subject: [ROOT] Re: CINT and QT
 
Hello Joachim,
 
To my understanding, there are few groups of people who are trying
to integrate Qt into Cint.   Difficulty of integrating non-cint
compliant
objects depends on nature and size of the library. For example, it would

be reasonable for OpenGL, X-Windows, but it would be very difficult for
MFC.  Judging from comments I get from the people, Qt integration
could be done with moderate effort. 
 
Could somebody in this mailing list respond to him about status of
Qt-Cint
integration?
 
Thank you
Masa Goto
 
----- Original Message ----- 
From: Giaco777 <mailto:giaco777@gmx.de>  
To: MXJ02154@niftyserve.or.jp <mailto:MXJ02154@niftyserve.or.jp>  
Sent: Sunday, December 22, 2002 9:15 AM
Subject: CINT and QT
 
Hi Masaharu,
 
have you ever thought of integrating trolltech's qt in CINT? This could
make
a fine GUI development/scripting environment, wouldn't it?
How hard would you estimate is that? From the description on how to
embed
this would mean to create a wrapper for all non-cint compliant objects
in the
header of the qt library. 
 
Bye
Joachim Knaeblein



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:24 MET