RE: [ROOT] standalone TApplication with QtRoot patch

From: Faine, Valeri (fine@bnl.gov)
Date: Thu Apr 24 2003 - 20:40:25 MEST


 Hello Christophe,

 Very likely you need to add -DR__QT cpp flag.
  
 Anyway the patch you applied doesn't contain the last changes I made.
 Tomorrow (I hope:-) I'll provide a patch for 3.05.04 with 
 the last  corrections.

  Mean time, can you try to get the last source from the CVS repository 
(see : http://root.bnl.gov/QtRoot/QtRoot.html#source )
 There one can find a script "root/root.diff/qtUtil/rootqtdiff"
 Feel free to send me any question / problem you might have met.

The help text this script provides describes how any ROOT version can be
adjusted to use Qt-layer.

This last CVS repository contains and advanced example of the pure
Qt-based RootShower application (Windows user will get it automatically
just the upgrade there ROOT Qt-based installation from
http://root.bnl.gov 
(see: ScreenShot  http://root.bnl.gov/QtRoot/RootShower.png )

The example provides the way to create Qt-based user ROOT application
that will work both on Windows and UNIX platforms.

I would advice you try sticking with the approach that is present below
to build your own application.
 

The directory "root/test/qtRootShower" contains Qt-based edition of the
original RootShower code written by Bertrand Bellenot  
( Bertrand.Bellenot@alcan.com). The orginal Non-Qt code it is available
from:

      ftp://root.cern.ch/root/RootShower.tar.gz

So you can compare two different approaches to judge which one you would
like to follow.

The goal of this example is to show how Qt-based ROOT can be used to
build 
the complex GUI. 
I tried to preserve the original design and code replacing the ROOT gui
classes 
with some from Qt GUI equivalents if possible.

To run this example one needs to install the ROOT Qt-based version  from

http://root.bnl.gov and invoke the example as follows:

              root RootShower.CC

The source code of the Qt-based version is available from the 
CVS repository (see: http://root.bnl.gov/QtRoot/QtRoot.html#source )

To retrieve the source code of the example alone do:

 cvs -d :pserver:cvs@usatlas.org:/rootbnl/cvs co root/test/qtRootShower

To re-compile (One is required to install Qt package first) the example
from the scratch:

1. Make RootCint dictionary:

   Windows:
      nmake -f Makefile.dict

   Unix:
      make  -f Makefile.gmake.dict

2. Build the main Makefile with "qmake" utility

      qmake RootShower.pro

3. Compile and build the share (DLL) library:

    [n]make

4. run the example:

    root RootShower.CC

5.  Enjoy.


    Valeri Fine (fine@bnl.gov)

> -----Original Message-----
> From: Christophe Delaere [mailto:delaere@fynu.ucl.ac.be]
> Sent: Thursday, April 24, 2003 1:01 PM
> To: Faine, Valeri
> Cc: roottalk
> Subject: Re: [ROOT] standalone TApplication with QtRoot patch
> 
> Hi,
> 
> I followed the instructions from the bnl site :
> 
> Download the "Qt" version (3.03/09a)
> Download the "Qt" patch to patch ROOT 3.03.09 for Unix
> 
> and compiled it by myself.
> 
> Christophe.
> 
> On Thursday 24 April 2003 18:22, you wrote:
> > Hello,
> >
> > Speaking about "ROOT using Qt" what did you? Did you download the
code
> > from http://root.bnl.gov and compile it yourself or you just use one
> > from afs area
> >
> >   Thank you
> >
> > > -----Original Message-----
> > > From: owner-roottalk@pcroot.cern.ch
> >
> > [mailto:owner-roottalk@pcroot.cern.ch]
> >
> > > On Behalf Of Christophe Delaere
> > > Sent: Thursday, April 24, 2003 11:19 AM
> > > To: roottalk
> > > Subject: [ROOT] standalone TApplication with QtRoot patch
> > >
> > > Hi all,
> > >
> > > I'm starting to use the patched version of ROOT using Qt on Linux.
> > > ROOT Version   3.03/09
> > >
> > > ROOT works very well, and I really appreciate the new features
> >
> > introduced
> >
> > > by
> > > Qt. But I've a problem running a standalone code. Here is the
> >
> > extremely
> >
> > > simple code I've written for testing purposes:
> > >
> > > -----------------------------
> > > #include <iostream>
> > > #include "TApplication.h"
> > > #include "TCanvas.h"
> > >
> > > int main(int argc, char** argv)
> > > {
> > >         TApplication ta("test",&argc,argv);
> > >         TCanvas c1("ctest","test canvas");
> > >         while(1) { ta.Run(); }
> > >         return 0;
> > > }
> > > --------------------------------
> > > compilation:
> > > g++ testme.cpp -o testme `root-config --cflags --glibs`
> > >
> > > With the standard ROOT, it works well. I can see the canvas and
> >
> > interact
> >
> > > with
> > > the menus. But if I try the modified ROOT version, I get a
segfault.
> >
> > Here
> >
> > > is
> > > what gdb tells me:
> > >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > [Switching to Thread 8192 (LWP 1850)]
> > > 0x40a1b307 in TPad::PaintBox(double, double, double, double, char
> >
> > const*)
> >
> > > ()
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > (gdb) bt
> > > #0  0x40a1b307 in TPad::PaintBox(double, double, double, double,
char
> > > const*)
> > >     () from /disks/scratch/install/root//lib/libGpad.so
> > > #1  0x40a1a835 in TPad::PaintBorder(short, bool) ()
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > #2  0x40a1afdc in TPad::PaintModified() ()
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > #3  0x40a01afa in TCanvas::Update() ()
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > #4  0x410407eb in TQtWidget::exitSizeEvent() ()
> > >    from /disks/scratch/install/root//lib/libQt.so
> > > #5  0x410405bb in TQtWidget::resizeEvent(QResizeEvent*) ()
> > >    from /disks/scratch/install/root//lib/libQt.so
> > > #6  0x412d44c8 in QWidget::event(QEvent*) ()
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #7  0x4124bc49 in QApplication::internalNotify(QObject*, QEvent*)
()
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #8  0x4124b4f1 in QApplication::notify(QObject*, QEvent*) ()
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #9  0x4124c5d4 in QApplication::sendPostedEvents(QObject*, int) ()
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #10 0x412d3170 in QWidget::show() () from
/usr/lib/qt-3.0.5/lib/libqt-
> > > mt.so.3
> > > #11 0x412d32c5 in QWidget::show() () from
/usr/lib/qt-3.0.5/lib/libqt-
> > > mt.so.3
> > > #12 0x41378e2c in QMainWindow::show() ()
> > > ---Type <return> to continue, or q <return> to quit---
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #13 0x412232fb in QWidget::showNormal() ()
> > >    from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
> > > #14 0x4103a448 in TQt::RaiseWindow(unsigned long) ()
> > >    from /disks/scratch/install/root//lib/libQt.so
> > > #15 0x41d04524 in TQtCanvasImp::Show() ()
> > >    from /disks/scratch/install/root//lib/libQtGui.so
> > > #16 0x409fd4ab in TCanvas::Constructor(char const*, char const*,
int)
> >
> > ()
> >
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > #17 0x409fd0ab in TCanvas::TCanvas(char const*, char const*, int)
()
> > >    from /disks/scratch/install/root//lib/libGpad.so
> > > #18 0x08048aff in main ()
> > > #19 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
> > >
> > > Do I forget sth important ?
> > >
> > > Thanks,
> > > Christophe.
> > >
> > >
> > > --
> > >
+-----------------------------------------------------------\|/---+
> > >
> > > | Christophe DELAERE            office: e253               !o o!
|
> > > | UCL - FYNU                    phone : 32-(0)10-473234    ! i !
|
> > > | chemin du cyclotron, 2        fax   : 32-(0)10-452183     `-'
|
> > > | 1348 Louvain-la-Neuve BELGIUM e-mail: delaere@fynu.ucl.ac.be
|
> > >
> > >
+-----------------------------------------------------------------+
> 
> --
> +-----------------------------------------------------------\|/---+
> | Christophe DELAERE            office: e253               !o o!  |
> | UCL - FYNU                    phone : 32-(0)10-473234    ! i !  |
> | chemin du cyclotron, 2        fax   : 32-(0)10-452183     `-'   |
> | 1348 Louvain-la-Neuve BELGIUM e-mail: delaere@fynu.ucl.ac.be    |
> +-----------------------------------------------------------------+



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET