Skip to content

Fix selection rect after porting from QFontMetrics::width()

Ismael Asensio requested to merge work/textRect into master

After porting from QFontMetrics::width() to QFontMetrics::boundigRect().width() in !10 (merged) we have a visual bug on selection rects, that can be seen on details and compact modes.

While from https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/ the use of boundingRect() would seem the right option to use (and I struggle to get the difference between the two methods when applied to a whole string and not a single char), in this case the horizontalAdvance() seems to return the value we need.

BUG: 421973 FIXED-IN: 20.07.70

Using boundigRect().width()

dolphin_bounding

Using horizontalAdvance()

dolphin_horizontalAdvance

Edited by Ismael Asensio

Merge request reports

Loading