[PyKDE] QTimer.singleShot()

Ruth Wright rwright at envisage-inc.com
Sun Feb 24 11:02:56 GMT 2002


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.

2) produces the error: QObject::connect: No such slot QFrame::dummy()
QObject::connect: (sender name: 'unnamed') 
QObject::connect: (receiver name: 'unnamed')
  
3) produces the error: QObject::connect: Parentheses expected, slot
QFrame::self.dummy
QObject::connect: (sender name: 'unnamed') 
QObject::connect: (receiver name: 'unnamed')

4) produces the error: QObject::connect: No such slot
QFrame::self.dummy()
QObject::connect: (sender name: 'unnamed') 
QObject::connect: (receiver name: 'unnamed')

Any pointers would be greatly appreciated.
-- 
Ruth Wright
Envisage Inc.






More information about the PyQt mailing list