From 434f6906f9088172494fa7e219a856d893ed55ba Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Sep 2023 11:23:44 +0200 Subject: Add TabBarStyle TypeError workaround --- doc/changelog.asciidoc | 2 ++ qutebrowser/mainwindow/tabwidget.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b02daf73e..c5abc1aef 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -32,6 +32,8 @@ Fixed no longer accumulate connections over time. (#7888) - The workaround for crashes when using drag & drop on Wayland with Qt 6.5.2 now also works correctly when using `wayland-egl` rather than `wayland` as Qt platform. +- Worked around a weird `TypeError` with `QProxyStyle` / `TabBarStyle` on + certain platforms with Python 3.12. - Upgraded the bundled Qt version to 6.5.3. Note this is only relevant for the macOS/Windows releases, on Linux those will be upgraded via your distribution packages. This Qt patch release comes with diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index c0c7ee2ad..42c31c97e 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -801,6 +801,11 @@ class TabBarStyle(QProxyStyle): ICON_PADDING = 4 + def __init__(self, style=None): + # "useless" override as WORKAROUND for + # https://www.riverbankcomputing.com/pipermail/pyqt/2023-September/045510.html + super().__init__(style) + def _base_style(self) -> QStyle: """Get the base style.""" style = self.baseStyle() -- cgit v1.2.3-54-g00ecf