Closed peterazmanov closed 9 years ago
@harvimt Do you have a Windows machine to test this on? I don't understand without testing why asyncio.ProactorEventLoop
would get double initialized though.
Is it because QObject
calls super().__init__()
that asyncio.ProactorEventLoop
gets double initialized? Difficult to tell without testing.
I tested on OS X, AFAICT QObject
does indeed call super().__init__()
so that the next baseclass (ProactorEventLoop
) gets initialized twice. So, in summing up, looks good to me.
@aknuds1 I tested this on Windows 7 machine with Python 3.4
I'm worried that this will be different depending on which Qt implementation is used. I suggest moving the object that can receive the signal into it's own object instead of subclassing QObject and ProactorEventLoop like I do in #29.
@harvimt why _ProactorEventLoop
(or any class in the quamash.QEventLoop
hierarchy) needs inheritance from QObject
? AFAICT, unix implementation is different in this regard.
to receive Qt signals, but like I said a better implementation is a dedicated signal receiver object.
On Wed, Nov 18, 2015 at 3:39 AM, Peter Azmanov notifications@github.com wrote:
@harvimt https://github.com/harvimt why _ProactorEventLoop (or any class in the quamash.QEventLoop hierarchy) needs inheritance from QObject? AFAICT, unix implementation is different in this regard.
— Reply to this email directly or view it on GitHub https://github.com/harvimt/quamash/pull/53#issuecomment-157685679.
@harvimt PyQt successfully connects signals to methods of non-QObject-subclass class. PyQt docs
Sorry not receive or send, but declare. Only EventPoller needs to be a QObject, I fix this in https://github.com/harvimt/quamash/commit/847df31c184125c8d147d74d17b690218e0cec2c, (which is part of #29, which I never merged)
I cherry-picked https://github.com/harvimt/quamash/commit/847df31c184125c8d147d74d17b690218e0cec2c, and updated the docstrings so flake8-docstrings stops bugging (new check they added), so this is fixed in master.
QtCore.QObject.__init__(self)
andasyncio.ProactorEventLoop.__init__(self, _IocpProactor())
causes double initialization of asyncio.ProactorEventLoop, according to mro. Possibly related to #38.