views:

25

answers:

1

Hi.

So I have a need to pass around a numpy array in my PyQt Application. I first tried using the new-style signals/slots, defining my signal with:

newChunkToProcess = pyqtSignal(np.array()), however this gives the error: TypeError: Required argument 'object' (pos 1) not found

I have worked out how to do this with the old-style signals and slots using self.emit(SIGNAL("newChunkToProcess(PyQt_PyObject)"), np.array([5,1,2])) - (yes, that's just testing data :), but I was wondering, is it possible to do this using the new-style system?

+1  A: 

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)

Prof.Ebral
What's the type for numpy arrays then?
Jords
I don't know, I don't use numpy. I think QT offers all the tools that numpy offers, so you are looking at dependency overkill. When you return a numpy array, is it a tuple, list, string, integer, dictionary .. what is it? And that is your answer.
Prof.Ebral