不支持C++类型的槽参数

2024-09-27 00:15:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试发出一个信号并发送两个参数,一个是Song对象的列表,第二个是QtGui.QTableView对象。在

我试过这么做:

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

但我得到了以下错误:

^{pr2}$

我能做什么?在


Tags: 对象self列表参数signal信号songtable
1条回答
网友
1楼 · 发布于 2024-09-27 00:15:48

如果你看一下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)

相关问题 更多 >

    热门问题