diff --git a/qt/aqt/qt.py b/qt/aqt/qt.py index 9c5dffc0e..3ce6e2fca 100644 --- a/qt/aqt/qt.py +++ b/qt/aqt/qt.py @@ -13,6 +13,7 @@ from PyQt5.Qt import * # type: ignore from PyQt5.QtCore import * from PyQt5.QtCore import pyqtRemoveInputHook # pylint: disable=no-name-in-module from PyQt5.QtGui import * # type: ignore +from PyQt5.QtWebChannel import QWebChannel from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWidgets import * diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 88b5b3a40..8220e26d7 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -30,9 +30,9 @@ class AnkiWebPage(QWebEnginePage): self._setupBridge() self.open_links_externally = True - def _setupBridge(self): + def _setupBridge(self) -> None: class Bridge(QObject): - @pyqtSlot(str, result=str) + @pyqtSlot(str, result=str) # type: ignore def cmd(self, str): return json.dumps(self.onCmd(str)) diff --git a/qt/mypy.ini b/qt/mypy.ini index 9adcb3d1b..ed6253bc7 100644 --- a/qt/mypy.ini +++ b/qt/mypy.ini @@ -88,3 +88,5 @@ check_untyped_defs=true check_untyped_defs=true [mypy-aqt.modelchooser] check_untyped_defs=true +[mypy-aqt.webview] +check_untyped_defs=true