PyQt5 bug in font settings

ullix ullix at urkam.de
Tue Oct 13 15:29:37 BST 2020


Am 13.10.20 um 14:52 schrieb Florian Bruhin:
> On Wed, Oct 07, 2020 at 06:24:27PM +0200, ullix wrote:
>> That would be another workaround. Presently I check for operating system and
>> set the font value that I know does work.
> FWIW if all you need is a monospace font, you can use
> QFontDatabase.systemFont(QFontDatabase.FixedFont)

Indeed that worked, thanks.

On Linux got DejaVu Sans Mono (as before), on Win10 now got Courier New, 
on Mac not tested.

Still the 'exactMatch:False' answer, although with nothing else 
specified, it should be true. Looks like your other references point to 
the problem.

As I have already released my new version with the work around, I may 
better wait for 5.15.2

ullix


>
> I have to admit I don't really understand how font handling in Qt works
> precisely, and there at leat three ways to obtain a "default" monospace
> font. See this comment for details:
>
> https://github.com/qutebrowser/qutebrowser/blob/v1.13.1/qutebrowser/config/configtypes.py#L1184-L1231
>
>
>> I am looking for proof or disproof that this is a bug. Nobody else has seen
>> this? Can someone replicate?
> If it is, it's most likely to be a Qt rather than PyQt one. You might
> want to search the Qt bugtracker: https://bugreports.qt.io
>
> For example, here's a bug that might be relevant which was introduced in
> Qt 5.15.1 and fixed in 5.15.2 (not released yet):
> https://bugreports.qt.io/browse/QTBUG-87267
> https://codereview.qt-project.org/c/qt/qtbase/+/317077
>
> Florian
>


More information about the PyQt mailing list