<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<pre>Hello,
I am trying to use QWinEventNotifier on PyQt 5.6 / Python 3.5 with a custom slot. My Problem is, that I can't figure out what decorator to use.
The relevant code snippet looks like this:
<br /><br />def register(self):
# Windows event
self.receive_event = win32event.CreateEvent(None, 0, 0, None)
# Code to register the event with the PCAN API
# ...
self.PCANrevieceEventHandler = QWinEventNotifier(parent=self)
self.PCANrevieceEventHandler.setHandle(ctypes.c_int(self.receive_event))
self.PCANrevieceEventHandler.activated.connect(self.msg_recev)
<br />@pyqtSlot( ) # I tried int, ctypes.c_int, ... nothing <br />def msg_recev(self, handle):<br /> # read the buffer<br /><br />
I get TypeError: connect() failed between activated(Qt::HANDLE) and unislot() <br /><br />I know, that in Qt 5.8 there would be QtSerialBus to propperly handle this, looking at the Qt src, QWinEventNotifier seems to be the right thing to use... <br /><br /></pre>
<pre>What is the propper way to do this? <br /><br />Best regards<br /><br />Sebastian</pre>
</body></html>