[Qt-interest] QStaticText rendering problems

Constantin Makshin cmakshin at gmail.com
Mon Sep 6 15:02:05 CEST 2010


Hi!

When drawing text with QPainter::drawStaticText() I've encountered two problems:
1) when large font is used, not all lines/curves are anti-aliased;
2) sometimes text leaves trails when the scene is being scrolled upwards.

Both problems can be seen on the attached "pt_drawstatictext.png" image (look at the large "3" digit). You can compare it to the case when text is drawn with QPainter::drawText().

I'm not sure if I need to provide the code because there are not so much configurable options that can cause these bugs.

Anti-aliasing is explicitly enabled by calling these functions:
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::TextAntialiasing);

All other rendering settings are at their default values. The only modified QPainter parameters are font and pen.

Has anyone had these problems? Are there any workarounds or configuration options I must set/change to get correct result?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pt_drawtext.png
Type: image/png
Size: 3851 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100906/d655ba49/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pt_drawstatictext.png
Type: image/png
Size: 2458 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100906/d655ba49/attachment-0001.png 


More information about the Qt-interest-old mailing list