Hi,
My QTextDocument is full of text.
However, when I run this code QTextLayout::lineCount() return always 0.

Qt Code:
  1. QTextBlock block = document->begin();
  2. while(block.isValid())
  3. {
  4. QTextLayout *layout= block.layout();
  5. int nbL=layout->lineCount();
  6. qDebug( "count lines = %i", nbL );
  7. }
To copy to clipboard, switch view to plain text mode 

Am I missing something?
What's wrong with it?

Plz help me guys, thanks.