RE: Qt thread seems blocked in ipython after gROOT.ProcessLine

From: Fine, Valeri <fine_at_bnl.gov>
Date: Thu, 21 Apr 2011 15:08:54 -0400


Hello Benjamin,

Where is your Qt thread come from?

Anyway, if you want the Qt thread working you should use PyRoot with QtRoot plugin. The latter is to provide you the Qt eventloop you (your application;-) likely need to manage the QThread messages properly. It is hard to be more concrete. One needs to see your code. Sorry, I did not understand why you spoke about the QThread yet.

Look up the RootForum, for Python + QtRoot keywords, please

Best regards , Valeri Fine



Brookhaven National Laboratory
Upton, NY 11973
Phone +1-631-344-7806

> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
On Behalf Of
> Benjamin Bannier
> Sent: Thursday, April 21, 2011 2:41 PM
> To: ROOT Talk
> Subject: [ROOT] Qt thread seems blocked in ipython after
gROOT.ProcessLine
>
> Dear ROOT experts,
>
> I am trying to use ipython as a convenient replacement for CINT, but
somehow loading my
> root_logon.C file seems to block the Qt thread.
>
> Simplified my shell.py looks like this
>
> #!/bin/env ipython
> import ROOT as r
>
> # uncommenting this blocks TCanvas updates
> #r.gROOT.ProcessLine('.x ~/.root_logon.C')
>
> When I execute this file and interactively enter
>
> h = r.TH1D('h', '', 100, -10, 10)
> h.Draw()
> h.FillRandom('gaus', 1000)
> h.Draw()
>
> I do see the filled TH1. With the last line in my wrapper script
uncommented I however need
> to click the canvas or issue a c1->Update() to update it.
>
> Putting above commands in a file script.py and running it
interactively in ipython with
>
> %run -i script.py
>
> does show the final, filled histogram in both cases.
>
> How can I work around this issue to both load my root_logon.C file and
keep TCanvases
> updating automatically?
>
>
> Thanks,
>
> Benjamin
Received on Thu Apr 21 2011 - 21:09:16 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 21 2011 - 23:50:02 CEST