summaryrefslogtreecommitdiff
path: root/cad/src/experimental/basic-qt-app/ticker.py
blob: a026d66a2d0df9c8d67df8cfef04cfc4a4bf4f08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright 2006-2007 Nanorex, Inc.  See LICENSE file for details. 
import sys
from PyQt4.Qt import *

class Ticker(QObject):

    def __init__(self):
        QObject.__init__(self)
        self.timer = timer = QTimer(self)
        #timer.setSingleShot(True)
        self.connect(self.timer, SIGNAL("timeout()"), self.hello)
        timer.start(1000)
		
    def hello(self):
        print 'hi it works'
        return 4
	
x=Ticker()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = QMainWindow()
    win.show()
    app.exec_()