How to make QTextLayout don't ignore 0x20(whitespace)
Solved
General and Desktop
-
Hello guys,
When I use QTextLayout to layout a multiline texts,if the QTextLine include 0x20 on the head or tail,QTextLayout will ignore and the QTextLine's width will less than tha actual width.
How can I to fix it?
My one solution is to replace 0x20 to 0xa0,but this will cause WordWrap don't work -
First, the docs say that QTextLayout is a low-level class and not normally used. Then, what happens if you change your text to a fixed space font? You need to elaborate on what you mean by "width less than actual width". Does the character count of the QString in the layout not reflect the spaces, or are you just visually not seeing the text occupying the expected screen realestate?