Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.0 RC2
-
None
Description
Creating text layout using QTextLayout while providing text (QString) which contains multiple lines and new line symbols of `\n`, `\r` or any combination of them, fails and renders them in one line.
It appears that QTextLayout works correctly only if line break symbol is provided as `QChar::LineSeparator`, hence each time it's necessary to conduct
text.replace('\n', QChar::LineSeparator);
and that is not not obvious. Above code-snippet is also present in QTextLayout unit tests
There is no documentation information - which I was able to find, what characters are supported for line breaking in QTextLayout context.
If implementation choice is justified then maybe it would be beneficial to add information into QTextLayout documentation, how to break lines.
Attachments
Issue Links
- relates to
-
QTBUG-104986 QTextLayout::maximumWidth() is not correct for multi-line text
-
- Closed
-