summaryrefslogtreecommitdiff
path: root/cad/src/experimental/basic-qt-app/ticker.py
blob: 39e6f678b77b11c90c27299ed7ce7ae8b0844945 (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_()