[PyKDE] underlying c/c++ object has been deleted on postEvent

Shin-ichi MORITA shin1_morita at yahoo.co.jp
Thu Jun 24 19:00:01 BST 2004


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/




More information about the PyQt mailing list