title: QTextDocument: get words with specific format
body: <p>I have a QTextDocument with some text where part of the text is underlined (misspellings).
  I want to parse the text and get the as formated words with positions.
  How?</p>
  <pre><code>for( auto textBlock = document()-&gt;begin(); textBlock != document()-&gt;end(); textBlock = textBlock.next() )
          {
              qDebug() &lt;&lt; &quot;textBlock::text: &quot; &lt;&lt; textBlock.text();
              for (auto t = textBlock.begin(); t != textBlock.end(); ++t)
              {
                  qDebug() &lt;&lt; &quot;&quot;;
                  auto fragment = t.fragment();
                  qDebug() &lt;&lt; fragment.text();
                  auto format = fragment.charFormat();
                  qDebug() &lt;&lt; format.fontUnderline();
                  qDebug() &lt;&lt; format.underlineStyle();
                  qDebug() &lt;&lt; format.underlineColor();
                  qDebug() &lt;&lt; &quot;&quot;;
              }
          }
  </code></pre>
  <p>But this always outputs:</p>
  <ol>
  <li>the entire content of QTextDocument.</li>
  <li>No underline, no style...</li>
  </ol>
  <p>So apparently I need to eithet get it another way, or somehow get deeper? How?</p>