mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
hack around broken qwebchannel behaviour
https://bugreports.qt.io/browse/QTBUG-53411
This commit is contained in:
parent
704610ef8f
commit
447718c605
1 changed files with 6 additions and 0 deletions
|
@ -129,6 +129,12 @@ class AnkiWebView(QWebEngineView):
|
||||||
def setHtml(self, html):
|
def setHtml(self, html):
|
||||||
app = QApplication.instance()
|
app = QApplication.instance()
|
||||||
oldFocus = app.focusWidget()
|
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)
|
self._page.setHtml(html)
|
||||||
# work around webengine stealing focus on setHtml()
|
# work around webengine stealing focus on setHtml()
|
||||||
if oldFocus:
|
if oldFocus:
|
||||||
|
|
Loading…
Reference in a new issue