我有3個connect function
在pyQt
和涉及3 signal
,one slot
和one widget
:QTableWidget的信號有什麼不同?
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第一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
工作正常。
我的問題是,什麼是第一個2 signal
和最後signal
之間的區別是什麼?