Drop-in replacement for QFontComboBox, better previews

Caslav Ilic caslav.ilic at gmx.net
Tue May 6 13:58:41 BST 2008


>> [: Alex Merry :]
>> Also, does the above NOTE mean that there's potential for breakage if the
>> user installs a later version of Qt?
>
> [: Thiago Macieira :]
> Yes, the code is using too much of Qt internals. That is not a good idea.
>
> My suggestion is simpler: make this code work in QFontComboBox directly.
> [...]

That code is a heuristic to decide what kind of sample text to show. If Qt
changes it internally, to improve the heuristic, the KDE is only left with
without that improvement. Hence the note to check it from time to time.

I did thought about proposing changes for the QFontComboBox directly, but I
think it is important to have a tighter integration between font choosers
and the particular DE. E.g. aside from the enhanced preview, I've also added
that little snippet in preparation of translating generic font names (and
this makes a lot of sense in any translation, avoiding the sometimes seen
confusion in English about them being some particular fonts, instead of
generic "frontends"). Then, as a next step, I've also thought of allowing
the user to set the sample text, by adding a side button to the combo box
(just an icon, like that for clearing a location bar) which pops up a small
dialog. Sumarily, I'd like to have a KFontComboBox for DE-specific bits and
pieces, and whatever internals gets offloaded to QFontComboBox in time, the
better.

I think a good option could also be to make the heuristic into a public
method of e.g. QFontDatabase, when the clint wants to query about such
stuff.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080506/499aff33/attachment.sig>


More information about the kde-core-devel mailing list