PyQt_PyObject equivalent when using new-style signals/slots?

一世执手 提交于 2019-12-04 04:56:21

The type you're looking for is np.ndarray You can tell this from the following code:

>>> arr = np.array([])  # create an array instance
>>> type(arr)           # ask 'what type is this object?'
<type 'numpy.ndarray'>

So your signal should look more like:

newChunkToProcess = pyqtSignal(np.ndarray)

(Notice I'm passing the type np.ndarray, rather than an array instance as you tried). If you don't want to worry about the type of the argument, you could instead use:

newChunkToProcess = pyqtSignal(object)

This should let you send any data type at all through the signal.

Also: numpy and Qt do not share any major functionality that I know of. In fact, the two are quite complementary and make a very powerful combination.

You are doing it wrong. You have to pass the data object type: int, str, ... in your case list

Like I am doing:

images = pyqtSignal(int, str);
failed = pyqtSignal(str, str);
finished = pyqtSignal(int)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!