From 447718c6056cdbff579d7501456a7ba6a7be35d0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 4 Jul 2016 16:25:24 +1000 Subject: [PATCH] hack around broken qwebchannel behaviour https://bugreports.qt.io/browse/QTBUG-53411 --- aqt/webview.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aqt/webview.py b/aqt/webview.py index 97168130d..8a8b110ea 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -129,6 +129,12 @@ class AnkiWebView(QWebEngineView): def setHtml(self, html): app = QApplication.instance() oldFocus = app.focusWidget() + + # hack around buggy qt 5.7.0 + print("fixme: qt 5.7.0 webview hack") + self._page = AnkiWebPage(self._onBridgeCmd) + self.setPage(self._page) + self._page.setHtml(html) # work around webengine stealing focus on setHtml() if oldFocus: