2012-03-24 104 views
0

我試圖發出一個信號併發送兩個參數,一個是Song對象列表,第二個是QtGui.QTableView對象。不支持C++類型的slot參數

我試着這樣做:

self.emit(QtCore.SIGNAL("searchOutput(list, QtGui.QTableView)"), songsObjs, self.table) 

,但我得到了以下錯誤:

TypeError: C++ type 'list' is not supported as a slot argument type 

我能做些什麼?

回答

5

如果你看看reference然後它說

It is possible to pass any Python object as a signal argument by specifying PyQt_PyObject as the type of the argument in the signature.

While this would normally be used for passing objects like lists and dictionaries as signal arguments, it can be used for any Python type.

所以會轉而做:

self.emit(QtCore.SIGNAL("searchOutput(PyQt_PyObject, QtGui.QTableView)"), songsObjs, self.table) 
相關問題