我有 3 个和connect function
与和pyQt
相关3 signal
:one slot
one widget
QtCore.QObject.connect(self.tableWidget, QtCore.SIGNAL(_fromUtf8("itemClicked(QTableWidgetItem*)")),
lambda: self.materialsInstance.setFilterDict_Insert("TW",self,"imported_party_attributes",0,self.tableWidget.currentItem().row(),self.tableWidget.currentItem().column()))
QtCore.QObject.connect(self.tableWidget, QtCore.SIGNAL(_fromUtf8("cellChanged(int,int)")),
lambda: self.materialsInstance.setFilterDict_Insert("TW",self,"imported_party_attributes",0,self.tableWidget.currentItem().row(),self.tableWidget.currentItem().column()))
###clear cell and remove from dict
QtCore.QObject.connect(self.tableWidget, QtCore.SIGNAL(_fromUtf8("currentCellChanged(int,int,int,int)")),
lambda: self.materialsInstance.setFilterDict_Insert("TW",self,"imported_party_attributes",0,self.tableWidget.currentItem().row(),self.tableWidget.currentItem().column()))#,"currentCellChanged(int,int,int,int))"))
我对 2 first 没有任何问题connect function
,但是我得到了以下 3th 的回溯connect function
:
Traceback (most recent call last):
File "/home/mohsen/codes/amlak/amlak/src/materialsInsertFrame.py", line 244, in <lambda>
lambda: self.materialsInstance.setFilterDict_Insert("TW",self,"imported_party_attributes",0,self.tableWidget.currentItem().row(),self.tableWidget.currentItem().column()))#,"currentCellChanged(int,int,int,int))"))
AttributeError: 'NoneType' object has no attribute 'row'
我没有任何想法Signal-Sloting
,你有吗?
注意: 2首先connect functions
工作正常。
我的问题signal
是,前 2和最后有什么区别signal
?