PyQt4 signals and slots

后端 未结 7 1841
执笔经年
执笔经年 2021-01-31 06:40

I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class:

self.loginDialog = LoginDialog();
         


        
7条回答
  •  礼貌的吻别
    2021-01-31 07:22

    Looks like you miss the "SLOT" part in your connect call.

    Here is an example :

    QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("NotifyMySignal(int)"), QtCore.SLOT("onNotifyMySignal(int)"));
    

    then

    self.emit(QtCore.SIGNAL('NotifyMySignal(1)'));
    

    Hope this helps !

提交回复
热议问题