diff options
author | Florian Bruhin <git@the-compiler.org> | 2018-06-21 17:14:29 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2018-06-21 21:43:47 +0200 |
commit | 10538738e0203a35b312be3d5331a77013bbc090 (patch) | |
tree | 7f3026f989b1498dd3b964c022e08f02f23de541 | |
parent | bd5f84bddf7e10297c0c1aab295356e18edd934f (diff) | |
download | qutebrowser-10538738e0203a35b312be3d5331a77013bbc090.tar.gz qutebrowser-10538738e0203a35b312be3d5331a77013bbc090.zip |
Don't depend on PyQt5.QtQuickWidgets to get RWHV
Some distributions (at least FreeBSD) don't package that module, so let's not
rely on it.
(cherry picked from commit 62d8b5b57497da86ddbfda359ef248e2fe706695)
-rw-r--r-- | qutebrowser/browser/webengine/webview.py | 10 | ||||
-rw-r--r-- | tests/end2end/fixtures/quteprocess.py | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index 03cdd035f..d1fdeb4e7 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -24,7 +24,7 @@ import functools import sip from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, PYQT_VERSION from PyQt5.QtGui import QPalette -from PyQt5.QtQuickWidgets import QQuickWidget +from PyQt5.QtWidgets import QWidget from PyQt5.QtWebEngineWidgets import (QWebEngineView, QWebEnginePage, QWebEngineScript) @@ -72,10 +72,10 @@ class WebEngineView(QWebEngineView): if proxy is not None: return proxy - # This should only find the RenderWidgetHostViewQtDelegateWidget, - # but not e.g. a QMenu - children = [c for c in self.findChildren(QQuickWidget) - if c.isVisible()] + # We don't want e.g. a QMenu. + rwhv_class = 'QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget' + children = [c for c in self.findChildren(QWidget) + if c.isVisible() and c.inherits(rwhv_class)] log.webview.debug("Found possibly lost focusProxy: {}" .format(children)) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 7d1cd2394..0c560cf51 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -361,9 +361,6 @@ class QuteProc(testprocess.Process): "Focus object changed: " "<qutebrowser.browser.webengine.webview.WebEngineView object " "at *>", - # Qt >= 5.11 with workarounds - "Focus object changed: " - "<PyQt5.QtQuickWidgets.QQuickWidget object at *>", ] if (log_line.category == 'ipc' and |