Long text and word wrap in QPainter
Hi,
I'ld like to print some text. Text is quite long (for example 1000 charcters). And I've text in QString text in one line (without any \n). I've tried to print it by:
Code:
QRectF textArea
(marginLeft,actTop,pageWidth,actLineHegiht
);
QRectF textArea3
= painter.
boundingRect(textArea,Qt
::TextWordWrap,tlumaczenie.
at(1));
painter.drawText(textArea, Qt::TextWordWrap, tlumaczenie.at(1),&textArea3);
painter.drawRect( textArea3 );
And last code's (drawRect( textArea3 )) drawing me a multiline (I think so) area, but text is still in one line :/
Why? How to print long text?
Re: Long text and word wrap in QPainter
Re: Long text and word wrap in QPainter
Hi
I'm displaying Strings with QGraphicsSceneTextItem.
With TextItem text length can be determined:
Code:
[INDENT][/INDENT]myTextItem->setTextWidth(100);
if will break the line automaticl