From 2a9444920bcd2f5d1832971bd6275ebdc5515546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 9 Aug 2024 11:15:53 +0200 Subject: macOS: Make NSServicesMenuRequestor implementation rich-text aware The protocol is used by services that interact with content in the application on behalf of the user. So far we have only been able to deal with plain text content, which resulted in wiping any formatting if the user tried to use a service to rewrite text in a rich text document. We now support rich text, by teaching our IM protocol how to deal with rich text for both reporting of the current text selection, as well as text insertion (commit). Unfortunately this doesn't help us for Writing Tools, as in 15.2 it no longer uses the NSServicesMenuRequestor protocol for insertion if we also implement NSTextInputClient. As a result we get insertions via insertText:replacementRange:, which is not prepared for rich text yet. [ChangeLog][macOS] Text services via the Services menu now support rich text extraction and insertion. Task-number: QTBUG-126238 Change-Id: I3d2933d766af8fe29e4f17636f703a257bf389fd Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qevent.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/kernel/qevent.cpp') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 762522daa0f..af3ad64689d 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2250,6 +2250,11 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos) variable can be used to set a selection starting from that point. The value is unused. + \value MimeData + If set, the variant contains a QMimeData object representing the + committed text. The commitString() still provides the plain text + representation of the committed text. + \sa Attribute */ -- cgit v1.2.3