Doc of QFile:pen says:
It works this way: when you only put \n at the end of a line, Notepad on Win32 will not display the text correctly. If you put \r\n at the end, vi will display ^M at the end of each line.Note: In WriteOnly or ReadWrite mode, if the relevant file does not already exist, this function will try to create a new file before opening it.
If only QT-Apps use the file, you can use endl and ignore all other editors, else you'll have to replace \r\n or \n to what you want before loading/saving.
Bookmarks