title: Unable to get highlighting working on TextEdit
body: <p>TL;DR: <code>TextEdit</code> paints highlighted text only when I click on it. Nothing helps</p>
  
  <p>I have a <code>ListView</code> with a <code>QAbstractListModel</code> model with string properties.
  Those string properties are being spellchecked and <code>QSyntaxHighlighter</code> is used to show spell errors. I create <code>QSyntaxHighlighter</code> descendant in <code>Component.onCompleted</code> of <code>TextEdit</code>. I double-checked highlighting get's executed with correct spell errors and <code>setFormat()</code> of Highlighter is executed with correct positions. The problem is that it draws text in red (invalidates) only when I click on the <code>TextEdit</code> itself.</p>
  
  <p><code>TextEdit</code> lives in a <code>Flickable</code> (to track cursor) and <code>Flickable</code> lives in a <code>Rectangle</code> (to have nice background and border). Binding to some signals and calling update() of <code>TextEdit</code> does not help.</p>
  
  <p>After spellcheck finishes, I emit <code>rehighlight()</code> signal of created SyntaxHighlighter.</p>
  
  <pre><code>Rectangle {
    id: descriptionRect
    height: 30
    border.width: descriptionTextInput.activeFocus ? 1 : 0
    clip: true
  
    Flickable {
        id: descriptionFlick
        contentWidth: descriptionTextInput.paintedWidth
        contentHeight: descriptionTextInput.paintedHeight
        anchors.fill: parent
        interactive: false
        flickableDirection: Flickable.HorizontalFlick
        height: 30
        clip: true
        focus: false
  
        function ensureVisible(r) {
            if (contentX &gt;= r.x)
                contentX = r.x;
            else if (contentX+width &lt;= r.x+r.width)
                contentX = r.x+r.width-width;
        }
  
        TextEdit {
            id: descriptionTextInput
            width: descriptionFlick.width
            height: descriptionFlick.height
            text: description
            onTextChanged: model.editdescription = text
  
            Component.onCompleted: {
                globalModel.initDescriptionHighlighting(index, descriptionTextInput.textDocument)
            }
  
            onCursorRectangleChanged: descriptionFlick.ensureVisible(cursorRectangle)
           }
       }
   }
  </code></pre>
  
  <p>Here is a small sample of project with demonstration of how it does not work until you click on a text <a href="https://bitbucket.org/ribtoks/qt-highlighting-issue" rel="nofollow noreferrer">https://bitbucket.org/ribtoks/qt-highlighting-issue</a></p>
  
  <p>Any ideas how I can solve this?</p>