Hello!
I modified the qtexample.py. The application is stopped, but with crash:
[pclhcb43] /afs/cern.ch/lhcb/software/DEV/FEICIM/FEICIM_v0r1 > gdb python
GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run qtexample.py
Starting program:
/afs/cern.ch/sw/lcg/external/Python/2.5/slc4_ia32_gcc34/bin/python
qtexample.py
Qt: Undefined variable.
[Thread debugging using libthread_db enabled]
[New Thread -1208854848 (LWP 30108)]
Detaching after fork from child process 30275.
** $Id: TGQt.cxx 26689 2008-12-06 07:03:04Z brun $ this=0x9423b90
Symbol font family found: Standard Symbols L
[New Thread -1212462176 (LWP 30281)]
TClass::TClass:0: RuntimeWarning: no dictionary for class QObject is
available
TClass::TClass:0: RuntimeWarning: no dictionary for class QWidget is
available
Bye bye...
[Thread -1212462176 (LWP 30281) exited]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208854848 (LWP 30108)]
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x024459fa in ROOT::delete_TQtWidget () from
/afs/cern.ch/sw/lcg/app/releases/ROOT/5.22.00c/slc4_ia32_gcc34/root/lib/libGQt.so
#2 0x014af7ec in TClass::Destructor () from
/afs/cern.ch/sw/lcg/app/releases/ROOT/5.22.00c/slc4_ia32_gcc34/root/lib/libCore.so
#3 0x00ae9ac9 in PyROOT::op_dealloc_nofree () from
/afs/cern.ch/sw/lcg/app/releases/ROOT/5.22.00c/slc4_ia32_gcc34/root/lib/libPyROOT.so
I think it is a pyRoot problem.
I also attached the modified qtexample.py what I am using.
Thanks,
Zoltan
From: qt-root-l-bounces_at_lists.bnl.gov on behalf of Qt-Root integration project
Sent: Thu 8/27/2009 6:59 PM
To: Qt-Root integration project; roottalk_at_root.cern.ch
Subject: Re: [Qt-root-l] How to terminate PyRoot+PyQt properly
Hello Zoltan,
I have looked up your "qtexample.py".
3 observations:
ROOT.gApplication.Terminate()
To terminate the application please consider connecting your "Quit" button with the "closeAllWindows" signal:http://qt.nokia.com/doc/4.5/qapplication.html#closeAllWindows
2) You certainly should not start the ROOT event loop:
ROOT.gApplication.Run(1) Your application is so-called "ROOT-based Qt-application." As such, it should start the Qt event loop with via QCoreApplication::exec () methodhttp://qt.nokia.com/doc/4.5/qcoreapplication.html#exec See: http://zetcode.com/tutorials/pyqt4/firstprograms Pay you attention to the clause from
You wonder why the exec_() method has the underscore?
Everything has a meaning.
This is obviously, because the exec is a python keyword.
And thus, exec_() was used instead.
. . . "
3) You certainly should connect the
the "lastWindowClosed" signal
http://qt.nokia.com/doc/4.5/qapplication.html#lastWindowClosed
with the "TerminateAndQuit()" slot of "CintSlot()" receiver. It is your "terminator". You connected it with "Terminate", you should connect it with "TerminateAndQuit()" instead.
I still have some concern about the hidden redundant for Qt application thread that PyRoot used to start. May be people who fought this issue in past can remind us the final solution.
Anyway, the corrections mentioned above have to applied first.
Can you try that to see whether it makes any difference? If your crash will persist, please start your application under gdb and send me the "Call stack"
Thank you.
Best Regards
Valeri Fine
Best Regards
Valeri Fine
> -----Original Message----- > From: qt-root-l-bounces_at_lists.bnl.gov [mailto:qt-root-l- > bounces_at_lists.bnl.gov] On Behalf Of Qt-Root integration project > Sent: Thursday, August 27, 2009 2:34 PM > To: roottalk_at_root.cern.ch > Cc: qt-root-l_at_lists.bnl.gov > Subject: [Qt-root-l] How to terminate PyRoot+PyQt properly > > > Hello, > I am trying to summarize the ROOT and qtRoot usage from afs. > After when I hard coded the .rootrc file. I used the following lines: > > ROOT.gEnv.SetValue("Gui.Backend","qt") > ROOT.gEnv.SetValue("Gui.Factory","qtgui") > ROOT.gEnv.SaveLevel(kEnvLocal); > > my application is working fine! But I can not stop it. I think > lastWindowClosed() slot is not comming! > I have the following lines: > > gLogger.debug('main') > > application = qApp > terminator = ROOT.TQtRootSlot.CintSlot() > termAddress =
> ,SLOT("Terminate()")) > from > Feicim.Gui.FeicimMainWidget > import FeicimMainWidget > mainWidget = FeicimMainWidget() > mainWidget.show() > mainWidget.start() > ROOT.gApplication.Run(1) > > If I coded ROOT.gApplication.Terminate() when I click in the File/Exit > menu item, the application is crash. > > You can check qtexample.py I attached the file. You can not exit the > program without crash. > Can you help me? > Thanks! > Zoltan _______________________________________________Qt-Root-l mailing list
This archive was generated by hypermail 2.2.0 : Fri Aug 28 2009 - 23:50:02 CEST