Standard Output Double Spaced in QTextEdit
-
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 ? -
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 ? -
Could be. Let me check.
-
Nope. Just '\n'.
-
Just found out the output of readLine is QByteArray. Will investigate further.
-
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 :)