PDA

View Full Version : multiline text on QPainter



amitpatel22
16th July 2011, 05:55
Hi...

i want to display multiline text on QPainter.
My problem is when i display the content of QTextEdit(multiline text),it display in the same line.

so please tell me that how can i display multiline text on QPainter..

waiting for quick reply..

Thanks..

nish
16th July 2011, 08:00
use
void QPainter::drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) to draw multiline text

amitpatel22
16th July 2011, 09:13
Thanks for reply..

But i want to use QTextEdit because i want to get all co-ordinates of that text through QPainterPath...

So please tell me that how can i use QTextEdit with multiline..

AlexSudnik
17th July 2011, 20:42
Probably I've not quite understood why you could not use what nish had suggested. I mean ,you can always get current position with the QPainterPath::currentPosition() in the active path,can't you? Just use this point in one of the overloaded QPainter::drawText methods with the Flag set to Qt::TextWordWrap...Some code would be nice, if you still experiencing the problem