summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-12-05 16:45:31 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2019-12-06 15:52:35 +0100
commit29adc0eed9b9dc3cce92f8acaaeaed3ab1bc6414 (patch)
tree39037a48dcd31e7df105a96ab536e5e0149c28c3 /src/gui
parentca7033935a26e2a11c7d872a6673e828eddf49ca (diff)
Fix updating the text cursor position after editing
In some cases when editing the text (for example when removing the selected text, or pasting a text block) the text cursor position is updated, but its visual x position is not updated. This causes the next cursor movements to start from a wrong position. Force the update for those cases. Fixes: QTBUG-78479 Change-Id: Ia496be62beec58660f5e1695e5aafae09c79684e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextcursor.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index c88497840f..056a854789 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -2261,6 +2261,7 @@ void QTextCursor::insertFragment(const QTextDocumentFragment &fragment)
d->remove();
fragment.d->insert(*this);
d->priv->endEditBlock();
+ d->setX();
if (fragment.d && fragment.d->doc)
d->priv->mergeCachedResources(fragment.d->doc->docHandle());