From 1cb57091ac33a0e062a579a3176f3f88ee7109cb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 28 Sep 2022 09:35:51 +0000 Subject: [PATCH] Revert "Keep original text for text/plain mime data" This also affects things like line breaks, effectively preventing the paste of copied text to non-Qt applications. This reverts commit 17eb0f2d8a84eb54e6e4fbfa981ca3bae8c7e919. [ChangeLog][QtGui][Drag&Drop] The fix to preserve special characters like   the text/plain part of the clipboard when copied from a QTextEdit or QLineEdit had to be reverted (QTBUG-107004). Fixes: QTBUG-107004 Change-Id: Ia226f38f31a368c381910e1d43b6422395a5744f Reviewed-by: Volker Hilsheimer Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit a51e7876b8adee2d6ddb721de9b4525cd1025ad7) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qwidgettextcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index cec18dbe697..e9702e8977e 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -3477,7 +3477,7 @@ void QTextEditMimeData::setup() const that->setData("application/vnd.oasis.opendocument.text"_L1, buffer.data()); } #endif - that->setText(fragment.toRawText()); + that->setText(fragment.toPlainText()); fragment = QTextDocumentFragment(); }