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

Noah Davis noreply at phabricator.kde.org
Sun Dec 29 09:04:26 GMT 2019


ndavis created this revision.
ndavis added reviewers: Breeze, Plasma.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
ndavis requested review of this revision.

REVISION 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.
  
  - [1] https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/

REPOSITORY
  R31 Breeze

BRANCH
  replace-deprecated-3 (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D26270

AFFECTED FILES
  kstyle/breezestyle.cpp

To: ndavis, #breeze, #plasma
Cc: cfeck, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191229/47c944cd/attachment.html>


More information about the Plasma-devel mailing list