[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] underlying c/c++ object has been deleted on postEvent
From:       Shin-ichi MORITA <shin1_morita () yahoo ! co ! jp>
Date:       2004-06-24 16:58:37
Message-ID: 20040624165837.10452.qmail () web2308 ! mail ! yahoo ! co ! jp
[Download RAW message or body]

Hi,

> > pretty basic. Or at least there might be other
> unrelated errors that

By the way,
QThread.start() need to be called to start worker thread.
The worker thread then calls your QThread.run().
In your code, QThread.run() is called directly from main
thread.

> >      def timeEvent(self):
> >              self._t.run()

Here is my script which retreives RSS channels in worker
thread:
    http://www.geocities.jp/ss_morita/rssrpull.py.txt
(Sorry, there is no comment in my script)

Good luck.


> > class UpdateThread(QThread):
> >      def __init__(self, ug):
> >              self._ug = ug
> >      def run(self):
> > #the line it raises an error at:
> >              QApplication.postEvent(self._ug,
> > NewMessageEvent(newMessages()))
> > class TimeObject(QObject):
> >      def __init__ (self, sys):
> >              self._sys = sys
> >              self._t = UpdateThread(UpdateGui(sys))
> >      def timeEvent(self):
> >              self._t.run()
> > I'm new to both KDE and Python programming, so the
> error might be
> > pretty basic. Or at least there might be other
> unrelated errors that
> > python hasn't been able to get to yet. I've posted
> full source code
> > at:
> > http://monroe.nu/projects/KNewGmail_broken.py
> > to run it also requires:
> > http://monore.nu/projects/KNewGmail/gmail.py
> 
> In all of your __init__ functions above you are
> forgetting to call the 
> super-class __init__ function.
> 
> Phil


__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic