[PyKDE] QThread problem

Phil Thompson phil at river-bank.demon.co.uk
Fri Dec 20 10:40:00 GMT 2002


On Thursday 19 December 2002 11:45 am, Steven Scott wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm running the latest Python, Qt, and PyQt.  I have this class:
>
> class BotThread( QThread ):
>         def __init__( self, bot, callback ):
>                 self.bot = bot
>                 self.callback = callback
>         def run( self ):
>                 try: self.bot.go()
>                 except TOCError: self.callback()
>
> and in a different class I have this code:
>
> self.bt = BotThread( self.bot, self.badSignOn )
> self.bt.start()
>
> When I run the script, I'm getting this output every time:
>
> progoth at billy pysp $ ./sp.py
> Traceback (most recent call last):
>   File "./sp.py", line 391, in connectButton_clicked
>     bt.start()
> AttributeError: sipThis
>
>
> it doesn't actually get into the run() function...I really don't know
> what's going on.  Does anybody have any insight into this problem?

This error is usually caused by sub-classing a Qt class and forgetting to call 
it's __init__() from the sub-class's __init__(). The above code has this 
error.

Phil




More information about the PyQt mailing list