diff options
Diffstat (limited to 'qutebrowser/misc/miscwidgets.py')
-rw-r--r-- | qutebrowser/misc/miscwidgets.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index 9c2101ca7..eef127cf2 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -268,6 +268,15 @@ class WrapperLayout(QLayout): class PseudoLayout(QLayout): + """A layout which isn't actually a real layout. + + This is used to replace QWebEngineView's internal layout, as a WORKAROUND + for https://bugreports.qt.io/browse/QTBUG-68224 and other related issues. + + This is partly inspired by https://codereview.qt-project.org/#/c/230894/ + which does something similar as part of Qt. + """ + def addItem(self, item): assert self.parent() is not None item.widget().setParent(self.parent()) @@ -285,11 +294,13 @@ class PseudoLayout(QLayout): return self.parent().render_widget() def setGeometry(self, rect): + """Resize the render widget when the view is resized.""" widget = self.widget() if widget is not None: widget.setGeometry(rect) def sizeHint(self): + """Make sure the view has the sizeHint of the render widget.""" widget = self.widget() if widget is not None: return widget.sizeHint() |