Is it a bug with QTextEdit?
-
QTextOption::WordWrap is doing what it is supposed to do:
bq. Text is wrapped at word boundaries.
If you want to add blank space at the beginning of a line you could use "NoWrap" or "ManualWrap".
-
testbugs, did u try to resize the window? :) the A should come back to the first line.
-
No, it is staying on the second line ... after resizing the window :)
-
You might want to try using QTextEdit::setPlainText instead of setText. The latter version tries to make a guess what kind of text it is dealing with (rich text or plain text).
-
[quote author="secretNinja" date="1303641377"]No, it is staying on the second line ... after resizing the window :)[/quote]
I tried your exact code and works fine for me though ...
-
I've made two copies (the code is testbugs's ;) ) and just resize the second one ... "A" goes to the second line (as it is supposed to do according to the documentation ... or at least I understand it that way).
!http://img822.imageshack.us/img822/7977/resizer.png(resize)!
-
I confirm the same behavior secretNinja :)
-
the problem is when "A" goes to the second line, the blank spaces before "A" disappeared. If i want to input two lines of blank spaces, what should i do in a wordwrap mode? Must I use ManualWrap to implement this myself?
-
[quote author="chetankjain" date="1303641793"][quote author="secretNinja" date="1303641377"]No, it is staying on the second line ... after resizing the window :)[/quote]
I tried your exact code and works fine for me though ...[/quote]
Input more blank spaces before "A" until it goes to the sencond line, and then you will find you can not input any more blank spaces.
-
Pressing "Enter" two time do the work. Could two new lines be used instead of two lines of spaces in what you want to do?
-
[quote author="secretNinja" date="1303643751"]Pressing "Enter" two time do the work. Could two new lines be used instead of two lines of spaces in what you want to do?[/quote]
I think it is different.
I will try if I can implement this by using ManualWrap, Thanks everybody!