写QT+python时遇到一个奇怪问题,谢谢
发表于 : 2010-11-01 17:26
代码是这样的:这里有一个奇怪的问题
写在一起的2个connect,第一个不能用,第2个可以正常关闭
如果把第一条的self.action换成self.mainwindow_super_words.close,那么也可以正常运行
我查看以前写的东西,也是这样的,调用自己写的slot,可以正常的,但是这个就不行了 ,问问高手呀,谢谢大家
代码: 全选
class Mainwindow_super_words(Ui_mainwindow_super_words):
def __init__(self, mainwindow_super_words):
self.mainwindow_super_words = mainwindow_super_words
self.parent = Ui_mainwindow_super_words(self.mainwindow_super_words)
self.connects()
self.mainwindow_super_words.show()
def connects(self):
QObject.connect(self.parent.action_logout,SIGNAL("triggered()"), self.action)
QObject.connect(self.parent.action_close, SIGNAL("triggered()"), self.mainwindow_super_words.close)
def action(self):
print "Hello"
如果把第一条的self.action换成self.mainwindow_super_words.close,那么也可以正常运行
我查看以前写的东西,也是这样的,调用自己写的slot,可以正常的,但是这个就不行了 ,问问高手呀,谢谢大家