Smart question !!
Well, hmm ok, am sorry I forgot the "block= block.next" , just in the thread ..

Here is a better exemple :

Qt Code:
  1. QTextDocument* document= new QTextDocument();
  2. QTextCursor cursorTest(document);
  3. cursorTest.movePosition(QTextCursor::Start);
  4.  
  5. cursorTest.insertText("Hello there");
  6. cursorTest.insertBlock();
  7. cursorTest.insertText("How are you?");
  8. QTextBlock block = document->begin();
  9. while(block.isValid())
  10. {
  11. QTextLayout *layout= block.layout();
  12. qDebug()<<"Block content : "<<block.text() ;
  13. qDebug()<<"Nb lines : "<<layout->lineCount();
  14. block = block.next();
  15. }
To copy to clipboard, switch view to plain text mode 

this code return :
>Block content : "Hello there"
>Nb lines : 0
>Block content : "How are you?"
>Nb lines : 0

is this normal?!