Does Qt support the Clipboard API? How do I use it?
-
[EDIT: I'm using Qt 6.2.4]
I'm trying to use Clipboard.write() to push some data from my application to the user's clipboard. I have
QWebEngineSettings::JavascriptCanAccessClipboard
and evenQWebEngineSettings::JavascriptCanPaste
set totrue
.When I try to call
navigator.clipboard.write()
from JS loaded on the page, it throws an exception"Write permission denied"
.If I check with
navigator.permissions.query()
forclipboard-write
, I get{ state: "denied" }
.How do I set that permission? MDN documentation linked above indicates it should be set automatically, although I don't know if "browser tabs" are a salient concept within the context of Qt. I haven't been able to find any additional knobs to turn by browsing the Qt documentation.
Thanks in advance.
-