[Interest] Text not displaying correctly in some cases (Qt 5.3, Mac OSX)

Adam Light aclight at gmail.com
Tue Apr 29 18:16:12 CEST 2014


Since updating my git checkout of Qt 5.3 a few days ago to the release
branch (I was previously using the stable branch as of early April) and
rebuilding Qt, I noticed that I sometimes get weird text drawing problems
in my application on Mac OSX 10.9.2 but not Windows 7.

If I compile my application with Qt 4.8.6, I don't see these problems on
either platform.

I have attached two examples of the same QPlainTextEdit subclass widget. In
one, each character is drawn as a rectangle in the widget itself (though,
oddly, the window's title is displayed correctly). In the other, the text
is drawn normally.

The only difference between the two is that the font size is a bit larger
in the window with the text properly drawn.


 [image: Inline image 2][image: Inline image 3]

If I change the text size back to what it was originally, the text is drawn
wrong again.

Here are printouts of the QFont after I set it:
Left example, text drawn incorrectly:
void WMPlainTextEdit::zoomIn(const double) QFont(
"Monaco,11,-1,5,50,0,0,0,0,0" ) pointSizeF: 11

Right example, text drawn properly:
void WMPlainTextEdit::zoomIn(const double) QFont(
"Monaco,13.75,-1,5,50,0,0,0,0,0" ) pointSizeF: 13.75

I see the same behavior if I try using different font families, and the
particular size doesn't seem to matter. For some font families, I have
found multiple font sizes that cause incorrect drawing, and some I have
found only one but have not tried an exhaustive search.

When my application starts, all text is drawn correctly in all places. I
can reproducibly cause the text in most places to start drawing wrong by
bringing up a specific dialog, but there are other ways that I can get the
text to start drawing wrong as well. When the text starts drawing wrong in
one place it will sometimes also draw wrong in other places (eg. contextual
menus, dialogs, etc.) but sometimes draw right.

I have looked through the Qt bug reports and don't see anything related to
this. I also tried building a few of the example projects and can't get the
text to draw incorrectly using an example. My coworkers also get this
behavior, and we're all running OSX 10.9.2 and using the same Qt 5.3 build.

I'd create a bug report but it'll probably be ignored since I can't provide
much information on how to reproduce this. Has anyone else seen this kind
of behavior or have any ideas where I should start to try to track down the
problem?

Thanks
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140429/bbf573c9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot_245.png
Type: image/png
Size: 15932 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140429/bbf573c9/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot_244.png
Type: image/png
Size: 10134 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140429/bbf573c9/attachment-0001.png>


More information about the Interest mailing list