term is a class that descends from QPlainTextEdit.

This is my code:
Qt Code:
  1. QByteArray ba = "Test123\r";
  2. term->insertPlainText(ba);
  3. term->insertPlainText("ABC");
To copy to clipboard, switch view to plain text mode 

I was expecting that the result of this code was like this:
Qt Code:
  1. ABCTest123
To copy to clipboard, switch view to plain text mode 
or
Qt Code:
  1. ABCt123
To copy to clipboard, switch view to plain text mode 
ABC should be in the same line that Teste123 was.
But the result is
Qt Code:
  1. Test123
  2. ABC
To copy to clipboard, switch view to plain text mode 

Just want the carriage return to return the carriage in the same line.
Is it possible or do I have to treat this kind of thing manually?

Thanks is advance