summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-05-06 16:30:24 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-07 04:05:51 +0000
commita772871a7112b897d3eacf1a86a8bc7824eda161 (patch)
treed896e3a263c7fca86472b714c9bd60ef82f686a4
parent6e3fcf47316cb201cd9f9d9e2e4ecc5bd0c85dcd (diff)
TextEdit: update all glyphnodes on QTD::contentsChanged() signal
When a syntax highlighter changes formatting, the actual text doesn't change, and QTextDocument emits contentsChanged() but not contentsChange(int, int, int). We need to regenerate QSG nodes. contentsChanged() is connected to QQuickTextControl::textChanged() and from there to QQuickTextEdit::q_textChanged(). Fixes: QTBUG-74572 Change-Id: Ia62aa6d3adfc9a9d496ee8811db4c2d963dd0c54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit d0ffa3c42bb58eef0d2a2c3326984695a60e9667) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quick/items/qquicktextedit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 0e62898d57..0aee8b2cb1 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -2359,6 +2359,14 @@ void QQuickTextEdit::q_textChanged()
d->determineHorizontalAlignment();
d->updateDefaultTextOption();
updateSize();
+
+ markDirtyNodesForRange(0, d->document->characterCount(), 0);
+ polish();
+ if (isComponentComplete()) {
+ d->updateType = QQuickTextEditPrivate::UpdatePaintNode;
+ update();
+ }
+
emit textChanged();
}