[Qt-interest] Cleartype in QGraphicsScene with QGLWidget as viewport

Samuel Rødal sroedal at trolltech.com
Wed May 13 15:20:52 CEST 2009


Dennis Kehrig wrote:
> Hello fellow Qts,
> 
> Although I am using Qt Jambi, my problem should apply to Qt as well.
> I am using Qt Jambi 4.5.0_01 (LGPL) on Windows XP SP 3.
> 
> I have a QGraphicsScene in a QGraphicsWidget. Items with text are
> displayed with Cleartype used for all font sizes, unless I change the
> viewport to a QGLWidget - then "normal" font sizes are not anti-aliased
> at all, while smaller and bigger are still anti-aliased with ClearType
> (at least they look just as good).
> 
> These render hints make no difference in that regard when using OpenGL:
> 
> setRenderHint(RenderHint.Antialiasing);
> setRenderHint(RenderHint.HighQualityAntialiasing);
> setRenderHint(RenderHint.TextAntialiasing);
> 
> Is there anything I can do to make Qt respect Windows settings even when
> using a QGLWidget for the viewport?
> 
> Thank you,
> 
> Dennis

Subpixel or cleartype antialiasing is not supported in the OpenGL paint 
engines at the moment. But to make sure you at least get antialiased 
text you should create your QGLWidget with sample buffers.

Simply pass a QGLFormat object that has been created with the format 
option QGL::SampleBuffers to the QGLWidget constructor to get 
multisample antialiasing.

http://doc.trolltech.com/4.5/qgl.html#FormatOption-enum

Regards,

Samuel



More information about the Qt-interest-old mailing list