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

From: Benjamin Bannier <bbannier_at_gmail.com>
Date: Thu, 21 Apr 2011 16:01:11 -0400


Hi Valeri,

> Where is your Qt thread come from?

That was my (probably wrong) guess that there was a thread running watching for necessary GUI updates.

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

I do not have QtRoot available and don't have enough control over my installation.

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

I reduced the problematic code to the snippet I provided. Here it is again:

> > #!/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()
> >
> > ...

Prompted by your suggestion to "create my application the ROOT way" I just for fun replaced

    r.gROOT.ProcessLine('.x ~/.root_logon.C')

with

    app = r.TRint('app')

and ended up with the same problem of the canvas not updating automatically after modification anymore.

To make sure I'd screw up as little as possible I emptied my .root_logon.C file so that it now looks like

    {
    }

My guess is that there is some automatic magic going on behind the scenes when I call gROOT.ProcessLine (like initialization of static objects) which messes up the canvas updates in my case. My question was how to work around this.

Thank you for your help,

Benjamin

Received on Thu Apr 21 2011 - 22:01:21 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 22 2011 - 05:50:02 CEST