Handle focusProxy being None
This fixes running with Qt 5.11 See https://codereview.qt-project.org/#/c/221408/10 and #3661: https://github.com/qutebrowser/qutebrowser/issues/3661#issuecomment-375969315
This commit is contained in:
parent
6640768860
commit
bc9a8dd63f
@ -755,7 +755,9 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
scripts.insert(new_script)
|
scripts.insert(new_script)
|
||||||
|
|
||||||
def _install_event_filter(self):
|
def _install_event_filter(self):
|
||||||
self._widget.focusProxy().installEventFilter(self._mouse_event_filter)
|
fp = self._widget.focusProxy()
|
||||||
|
if fp is not None:
|
||||||
|
fp.installEventFilter(self._mouse_event_filter)
|
||||||
self._child_event_filter = mouse.ChildEventFilter(
|
self._child_event_filter = mouse.ChildEventFilter(
|
||||||
eventfilter=self._mouse_event_filter, widget=self._widget,
|
eventfilter=self._mouse_event_filter, widget=self._widget,
|
||||||
parent=self)
|
parent=self)
|
||||||
@ -1102,4 +1104,6 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
self.predicted_navigation.connect(self._on_predicted_navigation)
|
self.predicted_navigation.connect(self._on_predicted_navigation)
|
||||||
|
|
||||||
def event_target(self):
|
def event_target(self):
|
||||||
return self._widget.focusProxy()
|
fp = self._widget.focusProxy()
|
||||||
|
assert fp is not None
|
||||||
|
return fp
|
||||||
|
Loading…
Reference in New Issue
Block a user