From ca6002fd585f70ff82229c2aed24fc2800065ba5 Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:30:51 +0800 Subject: [PATCH] remove image menu feature when on qt5 (#3685) --- qt/aqt/editor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index e1b120363..0806f3dc5 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -1473,6 +1473,8 @@ class EditorWebView(AnkiWebView): self.triggerPageAction(QWebEnginePage.WebAction.CopyImageToClipboard) def _opened_context_menu_on_image(self) -> bool: + if not hasattr(self, "lastContextMenuRequest"): + return False context_menu_request = self.lastContextMenuRequest() assert context_menu_request is not None return (