By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

Linux-Signal VS QT

P: n/a
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_()
--
LinuX Power
Feb 8 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.