PDA

View Full Version : QTextLayout, QTextLine::setNumColumns - strange behaviour



Dp0H
1st March 2012, 07:21
I want to layout the string:
"\ttext line 1\n\ttext line 2"
I replace '\n' with spaces and break line in these places manually.
1) In the first pass setNumColumns(13) is called. The line should be "\ttext line 1 ".
But after calling createLine() the textStart() returns 11(!), and '1' goes to the next line.
2) For string
"text line 1\n\ttext line 2"
(without first '\t') setNumColumns(12) leads to textStart() = 13, and the leading tab on the second line is disappeared.

I don't understand the logic :(