Skip to content

Commit

Permalink
Merge from 5.x: PR #16705
Browse files Browse the repository at this point in the history
Fixes #16703
  • Loading branch information
ccordoba12 committed Nov 2, 2021
2 parents 811fa0e + e7aa6cc commit 5e64dc3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spyder/widgets/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,15 @@ def setHtml(self, html, baseUrl=QUrl()):
else:
super(WebView, self).setHtml(html, baseUrl)

# The event filter needs to be installed every time html is set
# because the proxy changes with new content.
self.focusProxy().installEventFilter(self)
# This is required to catch an error with PyQt 5.9, for which
# it seems this functionality is not working.
# Fixes spyder-ide/spyder#16703
try:
# The event filter needs to be installed every time html is set
# because the proxy changes with new content.
self.focusProxy().installEventFilter(self)
except AttributeError:
pass

def load(self, url):
"""
Expand Down

0 comments on commit 5e64dc3

Please sign in to comment.