add typehint for eventFilter method

This commit is contained in:
BlueGreenMagick 2020-05-26 17:08:55 +09:00
parent eb032c4efb
commit 99663be358
2 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ class StudyDeck(QDialog):
self.redraw("", current) self.redraw("", current)
self.exec_() self.exec_()
def eventFilter(self, obj, evt): def eventFilter(self, obj: QObject, evt: QEvent) -> bool:
if evt.type() == QEvent.KeyPress: if evt.type() == QEvent.KeyPress:
if evt.key() == Qt.Key_Up: if evt.key() == Qt.Key_Up:
c = self.form.list.count() c = self.form.list.count()

View File

@ -227,7 +227,7 @@ class AnkiWebView(QWebEngineView): # type: ignore
activated=self.onPaste, activated=self.onPaste,
) )
def eventFilter(self, obj, evt): def eventFilter(self, obj: QObject, evt: QEvent) -> bool:
# disable pinch to zoom gesture # disable pinch to zoom gesture
if isinstance(evt, QNativeGestureEvent): if isinstance(evt, QNativeGestureEvent):
return True return True