[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui
From:       David Faure <faure () kde ! org>
Date:       2011-01-06 8:04:16
Message-ID: 201101060904.16989.faure () kde ! org
[Download RAW message or body]

On Thursday 06 January 2011, Jeremy Paul Whiting wrote:
> SVN commit 1212196 by whiting:
> 
> Initial import of KFontUtils from kdeedu/libkdeedu/kdeeduui into kdelibs.
> CCMAIL: aacid@kde.org
> 
> 
>  M  +2 -0      CMakeLists.txt
>  A             fonts/kfontutils.cpp   [License: LGPL]
>  A             fonts/kfontutils.h   [License: LGPL]

"DoNotAllowWordWrap" would be called "TextSingleLine" in Qt (if it means '\n' 
is treated as ' ') or "TextWordWrap" (if both '\n' and reaching the given 
width lead to word wrap).
I would suggest renaming that enum to one of these, depending on the intended 
meaning, for consistency.

I'm a bit surprised that the implementation uses boundingRect() rather than 
QFontMetrics::size(), which in my experience gives better results.

In fact why does this use QPainter at all? If we do this calculation at 
another moment than at painting time, then we don't have a QPainter -- and we 
don't need one. This could just use QFont and QFontMetrics instead.

-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic