So I have a terminal that prints out whatever my MCU is telling it to through serial communication, but I can't actually get that data and use it for anything.
QSerialPort* serial; //assume this is initialized and opened already
QByteArray data = serial->readAll();
terminal->putData(data); //this makes the terminal read it out to me
I'm trying to take this data and use it to do something with it, but I can't because it is in QByteArray format, or bytes.
I have each value separated by a comma, but I can't parse it because for some reason when I initialize it as a QString, it's actually a bunch of QStrings or something.
QString newData = QString(data); //data from before
qDebug() << newData;
This gives me the string but every character (sometimes every other character) is on a new line?
Output on terminal (What my debug should say):
Output at debug console:
Shouldn't the string be on one line? When I go to parse this I can't because it's like every character is a string or something.
Quick update: I cheated by using the QPlainTextEdit class's function called "toPlainText()" which simply does exactly what I want. I still think QString probably has some function that does this because the fix that I found isn't very versatile. So my problem isn't solved, but I've found a bandaid for it.