views:

38

answers:

1

Is it possible to get the bounding box of the output of QGLWidget::renderText() in logical or window coordinates? How?

A: 

You can try to use QFontMetrics::boundingRect(). Also maybe you'll need to consider how it handles the newline character (\n).

There's an overloaded QFontMetrics::boundingRect() that returns the bounding rect of the given text within a specified rectangle as well.

Yes, it works and the result would be in window coordinate as expected.Thanks for the answer!
mmonem