[Interest] Text in QGLWidget looks awful

Sven Anderson Sven.Anderson at snom.com
Thu Jun 14 11:53:28 CEST 2012



On 14.06.2012 09:01, Johan RĂ¥de wrote:
> Text rendered with a QPainter in a QGLWidget looks awful.
> I have attached two screen shots, one with text rendered in a QWidget
> and one with text rendered in a QGLWidget.
> I have also attached the code (Python + PySide) used to render the text.
>
> How do I fix this?
> How do I get nice-looking text in a QGLWidget?

It seems that QWidget always uses anti-aliased fonts, and QGLWidget uses 
bitmap fonts under a certain font size, in your example 12pt and 
smaller. I wouldn't say either is better. For my taste the optimum would 
be to use the bitmap font with 8pt, and anti-aliased fonts for 10pt and 
above. I have no idea how to adjust the threshold in Qt, I just know 
that font configurations often offer to adjust this threshold.

Best regards

Sven






More information about the Interest mailing list