import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class Runnable(QRunnable):
    def __init__(self):
        QRunnable.__init__(self)
        self.obj = QObject()

    def run(self):
        self.obj.emit(SIGNAL("testsignal"), 1, 2, 3)

class Win(QPushButton):
    def __init__(self):
        QPushButton.__init__(self, "Push me")
        self.tp = QThreadPool()
        self.connect(self, SIGNAL("clicked()"), self.slotClicked)

    def slotClicked(self):
        runnable = Runnable()
        self.connect(runnable.obj, SIGNAL("testsignal"), self.slotTestSignal)
        self.tp.start(runnable)

    def slotTestSignal(self, a, b, c):
        print "Returning from runnable", a, b, c

if __name__ == '__main__':
    app = QApplication(sys.argv)

    w = Win()
    w.show()

    app.exec_()
