Dutch112
10th August 2009, 18:04
Does anyone know how to specify the height of a QGraphicsTextItem? I've tried a number of ways and nothing seems to work.
QGraphicsTextItem text;
text.document()->setPageSize( QSizeF( 300,40) );
qreal w = text.document()->size().width(); // 300 - correct
qreal h = text.document()->size().height(); // 22 - why???
I've also tried setting the size property directly on QTextDocument but the same thing happens, it accepts the width but not the height.
QGraphicsTextItem text;
text.document()->setPageSize( QSizeF( 300,40) );
qreal w = text.document()->size().width(); // 300 - correct
qreal h = text.document()->size().height(); // 22 - why???
I've also tried setting the size property directly on QTextDocument but the same thing happens, it accepts the width but not the height.