Dear All,<br><br>I am struck with a problem while handling Signal and slot through pyqt<br><br>The problem is as follows:<br><br>I have three different menu items, each connected to the same event.<br>In side my event handling function , I want to find out which menu item was clicked.<br>
<br>I tried self.sender().objectName(),<br><br>But I get the following error: ("TF is my class name")<br><br><b>AttributeError: TF instance has no attribute 'sender'</b><br><br>When I tried to inherit the QObject class in my class, the above error is gone, but instead of getting the message "inside" it is not showing anything. (Neither the error message nor the "inside" message).<br>
<br>The code is as follows:<br><br>QtCore.QObject.connect( self.Pch, QtCore.SIGNAL("triggered()"), self.CR_Clicked )<br>QtCore.QObject.connect( self.TFe, QtCore.SIGNAL("triggered()"), self.CR_Clicked )<br>
QtCore.QObject.connect( self.IE, QtCore.SIGNAL("triggered()"), self.CR_Clicked )<br><br>def CR_Clicked(self):<br> eventName = self.sender().objectName()<br> <br> infoString = QString("inside")<br>
QMessageBox.information(self.iface.getMainWindow(),"SF",infoString)<br><br><br>It will be very kind of you if you can let me know as of where I am going wrong, or direct me to any link.<br><br><br>With Warm Regards,<br>
Bishwarup<br>