Use integer division to set font weight
QFont::setFontWeight takes an int only - it looks like PyQt accepts a float and just truncates it. That's the behaviour we actually want here, but let's be explicit about it.
This commit is contained in:
parent
d2751935e0
commit
462e07a578
@ -1119,7 +1119,7 @@ class QtFont(Font):
|
||||
font.setWeight(weight_map[namedweight])
|
||||
if weight:
|
||||
# based on qcssparser.cpp:setFontWeightFromValue
|
||||
font.setWeight(min(int(weight) / 8, 99))
|
||||
font.setWeight(min(int(weight) // 8, 99))
|
||||
if size:
|
||||
if size.lower().endswith('pt'):
|
||||
font.setPointSizeF(float(size[:-2]))
|
||||
|
Loading…
Reference in New Issue
Block a user