[PyQt] How to update the timer automatically in the tree view - Model/View programming

Detlev Offenbach detlev at die-offenbachs.de
Wed Mar 16 17:34:19 GMT 2011


On Mittwoch, 16. März 2011, Phil Thompson wrote:
> On Wed, 16 Mar 2011 14:51:39 +0100, "Hans-Peter Jansen" <hpj at urpla.net>
> 
> wrote:
> > On Wednesday 16 March 2011, 13:21:21 vijay swaminathan wrote:
> >> Hi All,
> >> 
> >> I'm a new bie to model/view programming and have just written a small
> >> script as attached.
> >> 
> >> For some reasons the time is not getting updated on the tree view. it
> >> gets updated only when I select that element on that tree. I did a
> >> searched and I was told that I got to use signal / slot mechanism to
> >> get the timer updated automatically.
> >> 
> >> I did give it a try but did not work. can someone pls help me on
> >> where exactly I went wrong.
> > 
> > First, you missed to start the timer. Next, just holding a parent
> > relationship to the timer seems not enough to keep the signal/slot
> > connection alive. Last, let's keep the M/V concept intact.
> > 
> > @Phil: for some reason, quitting this script triggers:
> > 
> > QObject::startTimer: QTimer can only be used with threads started with
> > QThread
> > QObject::startTimer: QTimer can only be used with threads started with
> > QThread
> > 
> > I've noticed this on other occasions, too. I guess, it's due to the
> > undefined destruction sequence of the python GC, where the timer
> > fires, but the signal handler was partly destructed already...
> > 
> > Do you have an idea on how to avoid that?
> 
> No, and it can also happen when you aren't using timers.
> 

I am observing this with the eric4/5 web browser as well. I didn't find the 
source of the issue either. However, I think it appeared with Qt 4.7. Since my 
update to Qt 4.7.2 I get this error as well.

Application asked to unregister timer 0x2b00000e which is not registered in 
this thread. Fix application.

I don't have any idea either. Any suggestions and help are welcome.

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list