Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2007
[QT 4.2] Text size before display.


Message 1 in thread

Hey there,

I'm using 
QPaint::drawText to display text in a widget.

Is there a way to get the length of the text bitmap before actually drawing it ?



Thanks.

Ben.

Message 2 in thread

bunjee wrote:
> I'm using
> QPaint::drawText to display text in a widget.
> Is there a way to get the length of the text bitmap before actually
> drawing it ?

Take a look at the QFontMetrics class.

--
 [ signature omitted ]