Improve RWHV typecheck for focusProxy
This commit is contained in:
parent
9725d9ce33
commit
cc497bf2ea
@ -72,12 +72,10 @@ class WebEngineView(QWebEngineView):
|
|||||||
if proxy is not None:
|
if proxy is not None:
|
||||||
return proxy
|
return proxy
|
||||||
|
|
||||||
# We only want the RenderWidgetHostViewQtDelegateWidget
|
# We don't want e.g. a QMenu.
|
||||||
# (which is a QWidget) but not e.g. a QMenu.
|
rwhv_class = 'QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget'
|
||||||
# pylint: disable=unidiomatic-typecheck
|
|
||||||
children = [child for child in self.findChildren(QWidget)
|
children = [child for child in self.findChildren(QWidget)
|
||||||
if type(child) == QWidget]
|
if child.inherits(rwhv_class)]
|
||||||
# pylint: enable=unidiomatic-typecheck
|
|
||||||
|
|
||||||
if not children:
|
if not children:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user