nibags added a comment.
`QFontMetrics::boundingRect(text).width()` doesn't deliver an exact value of the text width, since I detected that in some translations and some desktop themes the text goes below the scroll bar. This problem doesn't exist with `QFontMetrics::horizontalAdvance(text)`. For example, in the "Fusion" application style, with Portuguese language, it may be incorrectly seen: Before / After F7676460: Sin nombre.png <https://phabricator.kde.org/F7676460> REPOSITORY R39 KTextEditor BRANCH improve-word-wrap REVISION DETAIL https://phabricator.kde.org/D24983 To: nibags, #ktexteditor, cullmann, dhaumann Cc: kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann