-1

I am making simple serial communication app. Connection works well and I send data from my device to my app i am getting in log when I do qDebug() << dataByte:

"\x0B"
"\x0B"

Now I want to display this in a QTextEdit as "0B" string. How do I go about doing that? I read about QTextCodec but that is to convert 0B into a character which is not what I want.

Pls show me some guide thank you.

EDIT: I also tried

QString DataAsString = dataByte.toStdString();

But error comes up.

GeneCode
  • 7,545
  • 8
  • 50
  • 85

1 Answers1

1

Ok nvm I found the answer

QString DataAsString = data.toHex();
GeneCode
  • 7,545
  • 8
  • 50
  • 85