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>
This commit is contained in:
parent
f8efe8e0c9
commit
40ece5edcf
@ -667,6 +667,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx)
|
|||||||
|
|
||||||
if (dx || dy) {
|
if (dx || dy) {
|
||||||
viewport->scroll(q->isRightToLeft() ? -dx : dx, dy);
|
viewport->scroll(q->isRightToLeft() ? -dx : dx, dy);
|
||||||
|
QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
|
||||||
} else {
|
} else {
|
||||||
viewport->update();
|
viewport->update();
|
||||||
topLineFracture = 0;
|
topLineFracture = 0;
|
||||||
|
@ -1713,6 +1713,7 @@ void QTextEdit::scrollContentsBy(int dx, int dy)
|
|||||||
if (isRightToLeft())
|
if (isRightToLeft())
|
||||||
dx = -dx;
|
dx = -dx;
|
||||||
d->viewport->scroll(dx, dy);
|
d->viewport->scroll(dx, dy);
|
||||||
|
QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!\reimp
|
/*!\reimp
|
||||||
|
Loading…
Reference in New Issue
Block a user