An overlong word containing a hyphen could be broken anywhere, instead of after
the hyphen.
Example: compare the line breaking of
aaaaa-aaaaa-aaaaa-aaaaa
with
aaa aaaaa-aaaaa-aaaaa-aaaaa
(with a very narrow window)
This also improves Chinese text in some situations (#10299)
(cherry picked from commit
50ccbd2eab8cb01ff9f7c80d3fe726297dca6fae)
tl.setText(qs);
tl.setFont(font_);
QTextOption to;
- to.setWrapMode(force ? QTextOption::WrapAnywhere : QTextOption::WordWrap);
+ to.setWrapMode(force ? QTextOption::WrapAtWordBoundaryOrAnywhere
+ : QTextOption::WordWrap);
tl.setTextOption(to);
tl.beginLayout();
QTextLine line = tl.createLine();
- Fix bad painting of collapsable insets sub-label when selecting (bug 10475).
+- Always prefer breaking lines at word boundaries even for very long words. This
+ fixes line breaking issues most noticeably in languages where spaces are rare
+ such as Chinese (bug 10299).
* INTERNALS