Standard Output Double Spaced in QTextEdit
-
wrote on 26 Jan 2016, 21:44 last edited by
For some reason when I:
while (myRemoteProcess->canReadLine()) { ui.outputTextEdit->append(myRemoteProcess->readLine()); }
the text is double spaced. I tried removing the "\n" from each line, counted the number of spaces and tabs to see if there weren't too many, and made sure the text was noWrap - all to no avail. The doesn't happen if append lines manually. Any ideas?
-
Hi,
What does
myRemoteProcess->readLine()
return ? -
wrote on 26 Jan 2016, 23:15 last edited by
One QString with a <CR> (`\n'). It doesn't make any difference if a remove it.
-
Are you sure you don't have
\r\n
in your string ? -
wrote on 26 Jan 2016, 23:50 last edited by
Could be. Let me check.
-
wrote on 26 Jan 2016, 23:56 last edited by
Nope. Just '\n'.
-
wrote on 27 Jan 2016, 00:17 last edited by
Just found out the output of readLine is QByteArray. Will investigate further.
-
wrote on 27 Jan 2016, 16:38 last edited by
Ok. I found it. Here's what I did:
while (myRemoteProcess->canReadLine()) { QByteArray lineArray = myRemoteProcess->readLine(); QString lineString(lineArray); lineString.remove('\n'); ui.outputTextEdit->append(lineString); }
-
Good !
Since you have it working now please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)
2/9