mypy: event-handler signatures accept None (Qt stub overrides) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pr/mypy-event-signatures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mypy: fix the Qt stub override-signature bucket.
PyQt6 stubs declare event-handler parameters as
X | None; every override in the codebase used the non-Optional form, producing ~35 Liskov override errors. This PR widens the signatures and guardsNoneat the top of each handler (None events are no-ops):keyPressEvent— commandbar, compose, editor, helpwindow, paneleventFilter(compose),focusInEvent(panel)mousePressEvent/showEvent— SearchOverlay, _BarBoxresizeEvent/closeEvent— MainWindowrequestStarted— MessageHandler, EmbeddedImageHandlerjavaScriptConsoleMessage— MessagePagethread_model.parent—type: ignore[override](the no-argQObject.parent()overload isn't meaningful for a model)Rebased onto master after #15 merged: 152 → 122, zero new. #18 and #19 stack on this branch.
26642c124cto814bc00235814bc00235to68e2db50b2