Linux-Signal VS QT

M

Marco

Can I use LinuX signal as a tool for commuction with a QT(PyQt4) programme?

The follow code didNOT work...


from PyQt4 import QtCore,QtGui
import signal
import sys
import os

try:
import psyco
psyco.full()
except:
pass

class Main(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)

self.frame = QtGui.QFrame(self)
self.label = QtGui.QLabel(str(os.getpid()), self.frame)
signal.signal(15, self.sig_handler)
print signal.getsignal(15)

def sig_handler(self, signum, sframe):
print 'received!'
self.label.setText('haha')
self.show()

########################
# main routine #
########################
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)

main = Main()
main.show()
app.exec_()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top