[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] QTimer.singleShot()
From: Jonathan Gardner <jgardn () alumni ! washington ! edu>
Date: 2002-02-24 14:49:57
[Download RAW message or body]
On Friday 22 February 2002 11:16 pm, Ruth Wright wrote:
> Can anybody help me figure out how to use the singleShot method of a
> QTimer?
> In one of the methods for my class, I try to use singleShot, but always
> get errors:
> I've tried the following:
>
> class MyClass(QFrame):
> .....
> def someFunction(self):
> QTimer.singleShot(2,self,self.dummy); #---1
> QTimer.singleShot(2,self,SLOT("dummy()")); #---2
> QTimer.singleShot(2,self,SLOT("self.dummy")) #---3
> QTimer.singleShot(2,self,SLOT("self.dummy()")) #---4
> def dummy(self):
> print "hello";
>
>
> 1) produces the error: TypeError: Argument 3 of QTimer.singleShot() has
> an invalid type. The definition is for a char * method, and most other
> places that call for that seem to work fine using this syntax.
>
You'll want to try:
QTimer.singleShot(2, self.dummy)
And do you really want to wait 2 milliseconds?
Jonathan
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic