The above patch alone does not help as the database isn't used directly. Instead, requests are forwarded to Fontconfig, which is a good thing.
It then maps Qt weights back to FC weights: http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/text/qfontdatabase_x11.cpp#line1489
And the mapping looks as follows: 0.0 => Medium 0.0 ÷ 36.5 => Light 36.5 ÷ 56.5 => Medium 56.6 ÷ 69.0 => DemiBold 69.0 ÷ 81.0 => Bold 81.0 ÷ ∞ => Black
An attentive reader will find that there's no Regular there... Which means Qt will _never_ request a Regular font from Fontconfig, so as long as there's anything closer to Medium than Regular (e.g. Medium), it will choose that over Regular. What's more, it defaults to Medium, which seems a common pattern in that code: http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/text/qfontdatabase_x11.cpp#line777 http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/text/qfontdatabase_x11.cpp#line1069 http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/text/qfontdatabase_x11.cpp#line1078 http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/text/qfontdatabase_x11.cpp#line1491
The above patch alone does not help as the database isn't used directly. Instead, requests are forwarded to Fontconfig, which is a good thing.
It then maps Qt weights back to FC weights: qt.gitorious. org/qt/ qt/blobs/ 4.8/src/ gui/text/ qfontdatabase_ x11.cpp# line1489
http://
And the mapping looks as follows:
0.0 => Medium
0.0 ÷ 36.5 => Light
36.5 ÷ 56.5 => Medium
56.6 ÷ 69.0 => DemiBold
69.0 ÷ 81.0 => Bold
81.0 ÷ ∞ => Black
An attentive reader will find that there's no Regular there... Which means Qt will _never_ request a Regular font from Fontconfig, so as long as there's anything closer to Medium than Regular (e.g. Medium), it will choose that over Regular. What's more, it defaults to Medium, which seems a common pattern in that code: qt.gitorious. org/qt/ qt/blobs/ 4.8/src/ gui/text/ qfontdatabase_ x11.cpp# line777 qt.gitorious. org/qt/ qt/blobs/ 4.8/src/ gui/text/ qfontdatabase_ x11.cpp# line1069 qt.gitorious. org/qt/ qt/blobs/ 4.8/src/ gui/text/ qfontdatabase_ x11.cpp# line1078 qt.gitorious. org/qt/ qt/blobs/ 4.8/src/ gui/text/ qfontdatabase_ x11.cpp# line1491
http://
http://
http://
http://