Windows 7 SP1
MSVS 2010
Qt 4.8.4

Given this code:


Qt Code:
  1. #include <QTGui>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. QTextDocument* text_document = new QTextDocument("testing");
  6. QTextBlock text_block = text_document->begin();
  7. qDebug() << text_block.text() << text_block.blockFormat().lineHeight()
  8. << text_block.blockFormat().lineHeightType();
  9. }
To copy to clipboard, switch view to plain text mode 

The console displays:

"testing" 0 0

Question: Why doesn't lineHeight return "the LineHeight property for the paragraph"? The lineHeightType is set for single spacing.

Even trying:

Qt Code:
  1. qDebug() << text_block.text() << text_block.layout()->boundingRect().height();
To copy to clipboard, switch view to plain text mode 

gives me zero.