Fix QFontMetrics::width() deprecation warning by switching to boundingRect().width()
ClosedPublic

Authored by ndavis on Dec 29 2019, 9:04 AM.

Details

Summary

According to an article by @cfeck [1], QFontMetrics::width() gave the horizontal advance, which doesn't necessarily include every pixel that the text might use.
He suggested that boundingRect().width() might be what most people actually want.

Diff Detail

Repository
R31 Breeze
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ndavis created this revision.Dec 29 2019, 9:04 AM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 29 2019, 9:04 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ndavis requested review of this revision.Dec 29 2019, 9:04 AM
davidedmundson accepted this revision.Dec 29 2019, 2:21 PM
This revision is now accepted and ready to land.Dec 29 2019, 2:21 PM
This revision was automatically updated to reflect the committed changes.