From 01b825f7c66ced339983f68354d4d9a811a96e41 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 2 Sep 2025 15:55:18 +1000 Subject: [PATCH] Fix theme/checkboxes when path contains an apostrophe I couldn't find a list of other characters we might need to handle too. I tested with ", but Qt failed to start then. https://forums.ankiweb.net/t/qt-rendering-bug-in-check-boxes/66196 --- qt/aqt/theme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index 675eb9345..1e7b1f568 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -115,7 +115,7 @@ class ThemeManager: # Workaround for Qt bug. First attempt was percent-escaping the chars, # but Qt can't handle that. # https://forum.qt.io/topic/55274/solved-qss-with-special-characters/11 - path = re.sub(r"([\u00A1-\u00FF])", r"\\\1", path) + path = re.sub(r"(['\u00A1-\u00FF])", r"\\\1", path) return path def icon_from_resources(self, path: str | ColoredIcon) -> QIcon: