PDA

View Full Version : DrawText ?



whitefurrows
13th February 2007, 22:04
Hi,

i draw text like this:


drawText ( width()/2, height()/2, "a very long long text" );

How can i make a wordwrap if the text size more as the QWidget size?

Thanks in advance,

Whitefurrows

wysota
13th February 2007, 22:42
Use the version of drawText that takes a QTextOption. You can adjust word wrapping there. I think the variant that takes a QRect as its first parameter will work as well.


drawText(rect(), Qt::AlignCenter, "a very long long text", rect());

whitefurrows
14th February 2007, 21:08
That's it, work fine. Thank you!