Exclude QMenu when trying to find the missing focusProxy

This commit is contained in:
Florian Bruhin 2018-06-08 14:55:34 +02:00
parent 1531961aeb
commit 9725d9ce33

View File

@ -72,7 +72,13 @@ class WebEngineView(QWebEngineView):
if proxy is not None:
return proxy
children = self.findChildren(QWidget)
# We only want the RenderWidgetHostViewQtDelegateWidget
# (which is a QWidget) but not e.g. a QMenu.
# pylint: disable=unidiomatic-typecheck
children = [child for child in self.findChildren(QWidget)
if type(child) == QWidget]
# pylint: enable=unidiomatic-typecheck
if not children:
return None