Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5
-
None
Description
In a QGraphicsTextItem, if you make a selection on a normal text, or empty lines, or almost any combination of them, then press Enter, the selection in cleared and replaced by a new line that is added at the end of the cursor location (prior to selection). Expected.
If you make a selection that includes text and an empty line (or more) (content where an empty block is at the end of the selection), then press Enter, the "remove()" functions are not called. The QWidgetTextControlPrivate::insertParagraphSeparator() function is called instead, with the strange side effect that not only the inserted line (from pressing Enter) loses all formatting, but also the previous text block, which had some valid formatting prior to deletion.
So:
- the selected text is not removed;
- the selected lines (as many as they are) are not removed;
- a line is added (expected)
- the line has invalid formatting
- the previous block of text loses formatting
- functions such as QTextCursorPrivate::remove() and QTextFramePrivate::remove_me() are never called (they are called when the new line removes content where an empty block is not at the end of the selection).