Port from QFontMetrics::width() to boundingRect().width()
ClosedPublic

Authored by gladhorn on Wed, Aug 14, 7:49 AM.

Details

Summary

In all the cases that were changed, the bounding rect is needed. A few
places were not ported, since they need more careful investigation.
This reduces deprecation warnings.

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
gladhorn created this revision.Wed, Aug 14, 7:49 AM
Restricted Application added a project: Konsole. · View Herald TranscriptWed, Aug 14, 7:49 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
gladhorn requested review of this revision.Wed, Aug 14, 7:49 AM

yea, for reference also in https://doc.qt.io/qt-5/qfontmetrics-obsolete.html there are notes:
"Note that this value is not equal to boundingRect().width(); boundingRect() returns a rectangle describing the pixels this string will cover whereas width() returns the distance to where the next string should be drawn."

Yes, so for size hints, this should be fine. For actually placing individual chars and calculating their width in the terminal window I didn't dare changing things.

hindenburg accepted this revision.Sat, Aug 17, 2:23 PM

I agree thanks

This revision is now accepted and ready to land.Sat, Aug 17, 2:23 PM
This revision was automatically updated to reflect the committed changes.