can you show your code?I've tried setting EOL in the file to both DOS and Unix versions, but it makes no difference.
can you show your code?I've tried setting EOL in the file to both DOS and Unix versions, but it makes no difference.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
but you said:
So how/where did you try to set EOL?I've tried setting EOL in the file to both DOS and Unix versions,
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
In my text editor (where I created info.txt) I have the option of setting end-of-line to DOS format (CR-LF) or Unix format (LF). I've tried saving the file with each format, and in both cases QTextBrowser just concatenates all the lines in the display.
Added after 1 56 minutes:
I have now tried converting my text file to rich text (by saving it as .rtf in Word Pad). Now EOL is displayed as \par, with the same concatenation. At the head of the displayed text I see what is presumably the formating info for the rich text:
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\lang1033\f0\fs22
I'm wondering if QTextBrowser was designed just for html, but the docs say:
"The QTextBrowser class provides a rich text browser with hypertext navigation."
Last edited by gib; 21st April 2011 at 01:44.
what happens if you open your original file with a simple text editor line notepad or wordpad?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Sorry, I don't understand the question. As I said, I created the original file with a simple text editor, and then an RTF version with Wordpad. There's nothing special about these files. I've tested with other text files, and the result is always the same - loss of formatting when displayed in QTextBrowser. I'm using Qt 4.7.0, BTW.
Did you try with QTextEdit?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
QTextEdit does not have a member SetSource(). I chose to use QTextBrowser because I wanted to use SetSource(). I'm aware that I could achieve what I want by reading from the text file and writing to a QTextEdit widget. My query concerns getting EOLs recognized in QTextBrowser. Is the observed behaviour (replacement of EOL by space) also intended (i.e. is it a bug or a feature)?
Bookmarks