[PyQt] Bug in QAbstractNativeEventFilter in PyQt 5.1.1?

Klemetti, Antti antti.klemetti at f-secure.com
Wed Dec 11 08:11:20 GMT 2013


Hi,

I already posted the code snippet, but here is a simplified version
including the main function that installs the event filter to the QApplication:
------
import sys
from PyQt5.QtCore import QAbstractNativeEventFilter
from PyQt5.QtWidgets import QApplication

class WinEventFilter(QAbstractNativeEventFilter):
        def nativeEventFilter(self, eventType, message):
            return False, 0

if __name__ == "__main__":
    app = QApplication(sys.argv)
    win_event_filter = WinEventFilter()
    app.installNativeEventFilter(win_event_filter)
    sys.exit(app.exec_()) 
-----

Whoever calls the WinEventFilter.nativeEventFilter, 
from the PyQt framework crashes when the function returns.

BR, Antti
________________________________________
From: pyqt-bounces at riverbankcomputing.com [pyqt-bounces at riverbankcomputing.com] On Behalf Of Phil Thompson [phil at riverbankcomputing.com]
Sent: Tuesday, December 10, 2013 7:17 PM
To: pyqt at riverbankcomputing.com
Subject: Re: [PyQt] Bug in QAbstractNativeEventFilter in PyQt 5.1.1?

On 10-12-2013 12:19 pm, Klemetti, Antti wrote:
> Hi,
>
> You missed my point.
> If I return anything else than None (includes int values likes 0 and
> 1 and so on),
> the application using PyQt5 crashes.
> By returning None, I can avoid the crash, but I understand that I
> should return an int.
> Please try it yourself.

Then I need a simple, complete example that demonstrates the problem.

Phil
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list