1

Thanks for the code, it helped me solve a lot of problems with displaying text. But there is one symbol that haunts me:

[2K

but it looks like this: enter image description here

as far as I understand this symbol in ANSI means - erase the line and write new information in its place. What can I do with it?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Alex Rebell
  • 465
  • 3
  • 15

1 Answers1

0

This problem with this sign was solved by replacing the text with an empty value. My function where I applied substitution and formatting, the formatting function is listed by the link

void MainWindow::getLine(QByteArray output)
{
    QTextCodec *codec = QTextCodec::codecForName("UTF-8");
    QString pStr = codec->toUnicode(output.data());
    pStr.replace(QString("[2K"), QString(""));
    setTextTermFormatting(ui->textEdit, pStr);
}

Unfortunately, the comment can't convey exactly which character is being replaced (there is a picture in my question above of what the sign should look like), but the Qt syntax takes this sign properly and everything works, so if you will copy my code, be sure to change the replaced value.

Alex Rebell
  • 465
  • 3
  • 15