RE: [Qt-root-l] How to terminate PyRoot+PyQt properly

From: Fine, Valeri <fine_at_bnl.gov>
Date: Thu, 27 Aug 2009 14:48:43 -0400


Hello Zoltan,

> 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?

Alas, I have no PyRoot / PyQt installed to reproduce your issue quickly alone.

Did you try to connect "aboutToQuit"
http://qt.nokia.com/doc/4.5/qcoreapplication.html#aboutToQuit

          or lastWindowClosed  

http://qt.nokia.com/doc/4.5/qapplication.html#lastWindowClosed

signal to TQtRootSlot::TerminateAndQuit() slot ?

Anyway, can you start your application under the debugger to see the "call stack" at the time of the crash. It may help to pinpoint the origin of the problem.

In past, the problem used to come from the hidden PyRoot thread that was not terminated properly. In my mind, the solution was to eliminate that thread.

Thank you

Best Regards

                         Valeri Fine


Brookhaven National Laboratory
Upton, NY 11973, USA
Phone: +1 631 344 7806
Fax: +1 631 344 4206
E-mail: fine_at_bnl.gov

> -----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 =

sip.wrapinstance(ROOT.AddressOf(terminator)[0],QObject)
> QObject.connect(application,

SIGNAL("lastWindowClosed()"),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
Received on Thu Aug 27 2009 - 20:50:41 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 28 2009 - 05:50:04 CEST