[graphics/drawy/gsoc2026] src/gui/item: fix: preserve preedit format

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 6c0fbb6bdf2ba65c452fd431f19ab4ec4494dd99 by Laurent Montel, on behalf of Abdelhadi Wael.
Committed on 06/08/2026 at 18:09.
Pushed by mlaurent into branch 'gsoc2026'.

fix: preserve preedit format

M  +2    -1    src/gui/item/text.cpp

https://invent.kde.org/graphics/drawy/-/commit/6c0fbb6bdf2ba65c452fd431f19ab4ec4494dd99

diff --git a/src/gui/item/text.cpp b/src/gui/item/text.cpp
index 50b65282..3c07734f 100644
--- a/src/gui/item/text.cpp
+++ b/src/gui/item/text.cpp
@@ -415,7 +415,8 @@ void TextItem::updatePreedit(const QString &preedit, const QList<QInputMethodEve
             QTextLayout::FormatRange range;
             range.start = attr.start + m_cursor.positionInBlock();
             range.length = attr.length;
-            range.format = qvariant_cast<QTextCharFormat>(attr.value);
+            range.format = m_cursor.charFormat();
+            range.format.merge(qvariant_cast<QTextCharFormat>(attr.value));
             formats.append(range);
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.