2012-03-24 102 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) 
相关问题