RE: [ROOT] signals/slots in the ROOT standalone application

From: Valeri Fine (fine@bnl.gov)
Date: Thu Sep 02 2004 - 22:57:44 MEST


Hello Vassili,
Can you elaborate a little bit? What do you want to achieve  (may be in
private mail first)
 
   1. I ready sent another message telling I'll try to reproduce your
problem. ( I am on vacation and have no instant access to Unix machine)
 
   2. On the other hand it looks like there is some "terminology"
confusion. 
 
      Since you installed Qt package I assume you were speaking about Qt
signal/slot. 
      interface rather about ROOT Signal/Slots. ROOT "TG" Gui classes
has no Qt dependency and none emits 
      any specific Qt signals. I don't think one can use Qt signal/slot
to communicate 
      effectively with ROOT Gui classes.
     One can find the description of the Qt layer   published with some
papers
     http://root.bnl.gov/QtRoot/QtRoot.html#publications 
 
     Let me explain very briefly the main idea as soon as ROOT Gui
classes and Qt signal/slots are concern.
     When one uses the  ROOT with Qt layer for each ROOT TGWindow object

(see: http://root.cern.ch/root/htmldoc/TGWindow.html  )  TVirtualX Qt
implementation creates a "shadow plain" QWidget one
(see: http://doc.trolltech.com/3.3/qwidget.html )  The later is in
possession of many different Qt slots but emits no Qt signal.
I think this is "by design", because the main trick here is to keep the
ROOT gui free of any concrete graphical layer dependency.
 
Therefore I did not understand how you are going to use Qt signal/slot
with "guitest.C" example.
 
The main purpose of Qt layer is to provide the possibility to embed the
ROOT TCanvas into Qt-based application and versa verse
Use the Qt gui in ROOT-based application. "Guitest.C" does reveal
neither former nor later capabilities.
The http://root.bnl.gov <http://root.bnl.gov/>  Web site contains
several examples and I am going to provide others.
 
 I am keen to hear what you think about Qt layer and whether it meets
your expectation.
 
   Thank you, Valeri
 
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch] On Behalf Of Vassili Maroussov
Sent: Thursday, September 02, 2004 2:15 AM
To: Rene Brun
Cc: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] signals/slots in the ROOT standalone application
 
Dear Rene, 

there is no problem to build a standalone executable from
test/guitest.cxx (it doesn't use signal/slots), but I'm specifically
interested how to use the signal/slot mechanism (like in
tutorials/guitest.C) in standalone executables. 

Thank you, 

Vassili.

Rene Brun wrote:


see $ROOTSYS/test/guitest.cxx 
running make in the test directory will automatically build the
standalone 
executable guitest. 
Rene Brun 
Vassili Maroussov wrote: 
> 
> Dear All, 
> 
> there is an "#if" in the "tutorials/guitest.C"  that gives a hint it's

> possible to 
> build a standalone application if to #define STANDALONE: 
> 
> //------------------------------------------- 
> #ifdef STANDALONE 
> TROOT root("GUI", "GUI test environement"); 
> 
> int main(int argc, char **argv) 
> { 
>    TApplication theApp("App", &argc, argv); 
> 
>    if (gROOT->IsBatch()) { 
>       fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]); 
>       return 1; 
>    } 
> 
>    guitest(); 
> 
>    theApp.Run(); 
> 
>    return 0; 
> } 
> #endif 
> //------------------------------------------- 
> 
> In order to build a standalone application I've tried the following 
> naive way: 
> 
> 1) (I've) installed qt-free-3.3.3 with the "./configure -qt-gif
-thread"; 
> 2) installed ROOT-4.00.08 with "./configure --enable-qt
--enable-table"; 
> 3) copied ".rootrc" given at
http://root.bnl.gov/QtRoot/QtRoot.html#switch 
>    into the working directory ("$ROOTSYS/tutorials"); 
> 4) copied Makefile and Makefile.arch from "../test" to the working
dir.; 
>    and built an executable by "make guitest" (lazy guy); 
> 
> I've used the gcc version 2.96 20000731 (Red Hat Linux 7.2
2.96-112.7.1) 
> 
> I haven't got any compilation error message, but a core dump while
trying 
> to run the "./guitest": 
> 
> ------------- 
> ** $Id: TGQt.cxx,v 1.2 2004/07/11 04:14:11 brun Exp $ this=0x8a4ed90 
> Error in <TUnixSystem::DynamicPathName>: QtGui[.so | .sl | .dl | .a] 
> does not exist in 
>
.:/usr/local/ROOT/new/lib:/usr/local/ROOT/new/lib:./:/usr/lib/qt-3.3.3/l
ib 
> 
>  *** Break *** segmentation violation 
>  Generating stack trace... 
>  0x41593958 in <unknown> from /lib/i686/libc.so.6 
>  0x0805c32b in guitest(void) + 0x37 from ./guitest 
>  0x0805c3ed in main + 0x81 from ./guitest 
>  0x41581657 in __libc_start_main at 
>
/usr/src/build/230306-i686/BUILD/glibc-2.2.4/csu/../sysdeps/generic/libc
-start.c:129 
> from /lib/i686/libc.so.6 
>  0x0804eb81 in TGGroupFrame::TGGroupFrame(TGWindow const *, TGString
*, 
> unsigned int, unsigned long, unsigned long, unsigned long) + 0x3d from

> ./guitest 
> Aborted (core dumped) 
> ------------- 
> 
> What is a correct way to build a standalone version of "guitest.C"
with 
> signals/slots? 
> 
> Thank you, 
> 
> Vassili. 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET