Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Python by MV ( 17 years ago )
from PyQt4 import QtCore, QtGui


connector = QtCore.QObject()


def connected_to(source, signature):
    '''
    '''
    def connect(slot):
        connector.connect(source, QtCore.SIGNAL(signature), slot)
        return slot
    #
    return connect


app = QtGui.QApplication([])
timer = QtCore.QTimer()
timer.start(3000)


@connected_to(timer, 'timeout()')
def trigger():
    print 'Hello and exit!'
    app.exit()


print 'starting...'
app.exec_()

 

Revise this Paste

Your Name: Code Language: