Unfortunately, setting the document text width didn't help.
However, I noticed in the QTextDocument doc a warning mentioned for some other functions (not the lineCount() ) :
So, I tried to call lineCount() after drawing the doc and it works.Warning: This function only returns a valid value after the layout has been done.
This could explain the matter.
But am still in trouble:
Is there any way to "predict" the number of line of a block before being drawn?




Reply With Quote

Bookmarks