Windows 7 SP1
MSVS 2010
Qt 4.8.4
Given this code:
#include <QTGui>
int main(int argc, char *argv[])
{
qDebug() << text_block.text() << text_block.blockFormat().lineHeight()
<< text_block.blockFormat().lineHeightType();
}
#include <QTGui>
int main(int argc, char *argv[])
{
QTextDocument* text_document = new QTextDocument("testing");
QTextBlock text_block = text_document->begin();
qDebug() << text_block.text() << text_block.blockFormat().lineHeight()
<< text_block.blockFormat().lineHeightType();
}
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:
qDebug() << text_block.text() << text_block.layout()->boundingRect().height();
qDebug() << text_block.text() << text_block.layout()->boundingRect().height();
To copy to clipboard, switch view to plain text mode
gives me zero.
Bookmarks