Priority: P2: Important
Affects Version/s: 5.12.0
Fix Version/s: None
Component/s: Widgets: Widgets and Dialogs
With some fonts the width of the boundingRect as returned by QFontMetrics as got from the actual QLabel object seems to be out of sync with the width of what is actually rendered inside the QLabel.
Which breaks e.g. code which relies on the boundingRect to calculate some fixed size for a label widget.
Please find attached a sample program which should show the effect. Build & run it with:
fontfamily defaults to "Noto Sans"
-f to set the label to the fixedsize as calculated via boundingRect
For fonts like "Liberation Sans" or "Droid Sans" the widths were identical.
Which is quite surprising and seems like a bug, given the very QFontMetrics object was used that has been fetched from the very QLabel object, which by a quick look internally in the QLabel codebase at least in some path also seems to rely on that very QFontMetrics object.