Merge pull request #635 from BlueGreenMagick/typing

add typehint for eventFilter method
This commit is contained in:
Damien Elmes 2020-05-27 10:23:28 +10:00 committed by GitHub
commit 7ef884d3b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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()

View file

@ -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