[KRichTextEdit] Fix scroll jumping around when horizontal rule is added
ClosedPublic

Authored by poboiko on Apr 18 2020, 9:55 PM.

Details

Summary

Due to Qt bug 83605, it's not a good idea to setTextCursor while the cursor
is inside beginEditBlock / endEditBlock (scrollbar might jump to the top),
see KDE bug 195828. It's sufficient to move setTextCursor outside to fix it.
(it's never too late... :)

This patch also adds a test for this case (which currently fails due to
regression, see D28819: [KRichTextEdit] Always treat key press as single modification in undo stack and D28964: [KRichTextWidget] Remove ancient workaround and fix regression (commit 1d1eb6f) for the fix).

BUG: 195828

Test Plan

Diff Detail

Repository
R310 KTextWidgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poboiko created this revision.Apr 18 2020, 9:55 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 18 2020, 9:55 PM
poboiko requested review of this revision.Apr 18 2020, 9:55 PM
dfaure accepted this revision.Apr 19 2020, 9:21 AM

Nice work.

This revision is now accepted and ready to land.Apr 19 2020, 9:21 AM
This revision was automatically updated to reflect the committed changes.