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