[PyQt] PYQt defaults to fonts looking bold on macOS but C++ Qt does not

Phil Thompson phil at riverbankcomputing.com
Wed Jul 6 12:58:31 BST 2016


On 6 Jul 2016, at 12:48 pm, Barry Scott <barry at barrys-emacs.org> wrote:
> 
>> 
>> On 6 Jul 2016, at 12:16, Florian Bruhin <me at the-compiler.org> wrote:
>> 
>> * Barry Scott <barry at barrys-emacs.org> [2016-07-06 12:08:02 +0100]:
>>> 
>>>> On 6 Jul 2016, at 12:04, Phil Thompson <phil at riverbankcomputing.com> wrote:
>>>> 
>>>> On 6 Jul 2016, at 11:55 am, Barry Scott <barry at barrys-emacs.org> wrote:
>>>>> 
>>>>>> 
>>>>>> On 6 Jul 2016, at 11:50, Phil Thompson <phil at riverbankcomputing.com> wrote:
>>>>>> 
>>>>>> On 6 Jul 2016, at 11:26 am, Barry Scott <barry at barrys-emacs.org> wrote:
>>>>>>> 
>>>>>>> Compare the windows snapshots taken for a PyQt5 app and a C++ Qt5 app
>>>>>>> that use a QLabel control.
>>>>>>> 
>>>>>>> http://www.barrys-emacs.org/export/Qt5.png
>>>>>>> 
>>>>>>> http://www.barrys-emacs.org/export/PyQt5.png
>>>>>>> 
>>>>>>> You can see that the text in PyQt5 looks like it is bold compared to the
>>>>>>> Qt5 version.
>>>>>>> 
>>>>>>> On Fedora I see that same text for Qt5 and PyQT5.
>>>>>>> 
>>>>>>> Please fix this problem in PyQt5.
>>>>>>> 
>>>>>>> The source code I used is in:
>>>>>>> 
>>>>>>> http://barrys-emacs.org/export/font-example.tar.gz
>>>>>>> 
>>>>>>> Note: This bug affects all text, list, tables, line edit everything.
>>>>>> 
>>>>>> ...on your system. It works fine for me. PyQt does nothing with fonts.
>>>>> 
>>>>> Oh. I have not knowingly done anything that would cause this.
>>>>> 
>>>>> If I wanted to globally change the font used by PyQt5 how would I do it?
>>>>> Is there a config file that PyQt5 will read that Qt will not?
>>>> 
>>>> No.
>>> 
>>> I guess I’m about to learn how dtrace works to find the difference.
>> 
>> Are you sure you're using the exact same Qt version via PyQt?
> 
> Qt.PYQT_VERSION_STR 5.6
> QtCore.QT_VERSION_STR 5.6.1

That gives you the version of Qt it was compiled against, not the version of Qt it is running with. Use QtCore.qVersion().

Phil


More information about the PyQt mailing list