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

Dennis Kehrig mail at denniskehrig.de
Wed May 13 16:29:14 CEST 2009


Hello,

thank you for your reply. It turns out my problem is really simple to
solve: just cache the item - item.setCache(...)
The caching seems to be done without OpenGL, at least the fonts are
anti-aliased at all sizes this way.

Have a nice day, everyone.

Dennis


Samuel Rødal schrieb:
> 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