Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2, 6.3.0
-
None
Description
In the example project "Qt Quick Controls - Text Editor", it is shown how to use TextArea to create a very basic rich text editor in QML. One issue I've encountered with this example is that the formatting of text fails when either the TextArea is empty or when the cursor points at a location in the text document after a space. For example, if you run the example, delete all text and then click "B" (or press Ctrl+B) nothing happens and typing doesn't result in bold text. If on the other hand, you type something and then click "B", the formatting is correctly applied.
This happens with all the other formatting options too.
It seems that DocumentHandler::mergeFormatOnWordOrSelection fails to merge the character format whenever the text document is empty or the cursor is not located at a non-empty word.