On Sat, Dec 02, 2006 at 01:04:15PM +0100, Georg Baum wrote:

> Am Freitag, 1. Dezember 2006 12:02 schrieb Enrico Forestieri:

> > Maybe your patch could be augmented like the attached?
> 
> That is OK with me, provided you find out that the comment about lying 
> QFontInfo is not true anymore.

Seemingly, this was a sort of bug in older Qt versions. See for example
http://lists.trolltech.com/qt-interest/2000-02/thread00025-0.html
where the same problem is illustrated (and a possible workaround given).

However, trusting the documentation at
http://doc.trolltech.com/4.2/qfontinfo.html

   The QFontInfo class provides the same access functions as QFont,
   e.g. family(), pointSize(), italic(), weight(), fixedPitch(),
   styleHint() etc. But whilst the QFont access functions return the
   values that were set, a QFontInfo object returns the values that
   apply to the font that will actually be used to draw the text.

   For example, when the program asks for a 25pt Courier font on a
   machine that has a non-scalable 24pt Courier font, QFont will
   (normally) use the 24pt Courier for rendering. In this case,
   QFont::pointSize() returns 25 and QFontInfo::pointSize() returns 24

and taking into account the fact that the setCharSet() method is not
available anymore, I would say that the patch is correct.

Moreover, I would also revert your logic, and ask for evidence that the
patch would fail on some platform, given that it is demonstrated that
the code actually fails without the patch at least on one platform.

-- 
Enrico

Reply via email to