QML TextArea colored text with selection
<p>i am trying to accomplish the following behavior with a QML TextArea:</p>

<ol>
<li>I want single Words in the Text to be colored differently</li>
<li>I want the "select"-functions to be working for automated scrolling (user interaction is disabled)</li>
</ol>

<p>There is a stream of text in the TextArea where one Word needs to be selected(highlighted). The user is requested to input some text elsewhere and press enter to proceed (not part of the question). After that the selection jumps to the next word and the last selected word is either colored green or red. There is only a small portion of the text visible (a few lines, managed by the TextArea height – not part of the question) and i need the text to scroll if the next word is out of that visible range .. therefore the selection is quite helpful because all interaction from the user – to scroll or select or whatever – is disabled (disabling is not part of the question) </p>

<p>my main problem is: if i use <code>textFormat: TextEdit.RichText</code> i can easily color the text how i like it to be (<code>&lt;font  color=\"green\"&gt;{}&lt;/font&gt;</code>) but i cannot use the "select"-functions anymore because – as i would guess – the selection works on the "plaintext" and cannot correspond to the "richtext"-selection? Anyway <code>selectWord()</code> etc. does not work <code>QTextCursor::setPosition: Position '-1' out of range</code> is the result. But if i disable the RichText i don't know how to color the text. Maybe i could live without the selection if i could detect the current word – which would be colored blue etc. – and scroll if its out of the visible area to "fake" the selection behavior, but that's just a third option. </p>

<p>I would really either know how to color non-Rich Text or how to select Rich Text in a TextArea.</p>