From 99663be3589b5ae32f3e53ee61d448f3ed43388a Mon Sep 17 00:00:00 2001 From: BlueGreenMagick <50060875+BlueGreenMagick@users.noreply.github.com> Date: Tue, 26 May 2020 17:08:55 +0900 Subject: [PATCH] add typehint for eventFilter method --- qt/aqt/studydeck.py | 2 +- qt/aqt/webview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/aqt/studydeck.py b/qt/aqt/studydeck.py index afa321cb1..493f2307a 100644 --- a/qt/aqt/studydeck.py +++ b/qt/aqt/studydeck.py @@ -75,7 +75,7 @@ class StudyDeck(QDialog): self.redraw("", current) self.exec_() - def eventFilter(self, obj, evt): + def eventFilter(self, obj: QObject, evt: QEvent) -> bool: if evt.type() == QEvent.KeyPress: if evt.key() == Qt.Key_Up: c = self.form.list.count() diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 92819d64a..43010d85e 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -227,7 +227,7 @@ class AnkiWebView(QWebEngineView): # type: ignore activated=self.onPaste, ) - def eventFilter(self, obj, evt): + def eventFilter(self, obj: QObject, evt: QEvent) -> bool: # disable pinch to zoom gesture if isinstance(evt, QNativeGestureEvent): return True