Revert "Allow copying of images using context menu"
This reverts commit d5b3927d0b
.
This approach no longer appears to work in Qt6. There is a
QWebEngineView.lastContextMenuRequest() that may work, though whether
onCopy() qualifies as "during contextMenuEvent" is not clear.
https://doc.qt.io/qt-6/qwebengineview.html#lastContextMenuRequest
This commit is contained in:
parent
aabf693bb8
commit
aaceeec25a
@ -282,14 +282,7 @@ class AnkiWebView(QWebEngineView):
|
||||
w = w.parent()
|
||||
|
||||
def onCopy(self) -> None:
|
||||
if not self.selectedText():
|
||||
if not isMac:
|
||||
# crashes on a mac when clicking in the main window and pressing cmd+c
|
||||
ctx = self._page.contextMenuData()
|
||||
if ctx and ctx.mediaType() == QWebEngineContextMenuData.MediaTypeImage:
|
||||
self.triggerPageAction(QWebEnginePage.CopyImageToClipboard)
|
||||
else:
|
||||
self.triggerPageAction(QWebEnginePage.Copy)
|
||||
self.triggerPageAction(QWebEnginePage.Copy)
|
||||
|
||||
def onCut(self) -> None:
|
||||
self.triggerPageAction(QWebEnginePage.Cut)
|
||||
|
Loading…
Reference in New Issue
Block a user