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

Authored by gladhorn on Aug 14 2019, 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
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15073
Build 15091: arc lint + arc unit
gladhorn created this revision.Aug 14 2019, 7:49 AM
Restricted Application added a project: Konsole. · View Herald TranscriptAug 14 2019, 7:49 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
gladhorn requested review of this revision.Aug 14 2019, 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.Aug 17 2019, 2:23 PM

I agree thanks

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