summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2016-04-13 14:40:54 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2016-04-13 12:48:33 +0000
commit40ece5edcfcc5674524332a4db500371cc109330 (patch)
tree1db0c5ed037c04f2b0739fe53ec441abc338177a
parentf8efe8e0c91905d5077131d343f2ae2b3ca7daa2 (diff)
QTextEdit: update cursor and anchor rect upon scrolling
Both cursor and anchor rect will change locally when scrolling. So inform IM about it, so that any overlay done from e.g the platform plugins for dealing with text selection etc. can respond to the change. Change-Id: I4e839e691a20ad07d2aa062e028d22cf5f31b7fa Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp1
-rw-r--r--src/widgets/widgets/qtextedit.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 35ec88b881..1da8028efb 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -667,6 +667,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx)
if (dx || dy) {
viewport->scroll(q->isRightToLeft() ? -dx : dx, dy);
+ QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
} else {
viewport->update();
topLineFracture = 0;
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 68b6ea6cbe..a81781bd4d 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1713,6 +1713,7 @@ void QTextEdit::scrollContentsBy(int dx, int dy)
if (isRightToLeft())
dx = -dx;
d->viewport->scroll(dx, dy);
+ QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
}
/*!\reimp