I am reading a String from the Arduino, which comes like this:
string_outData = 'a' + string_1 + '&' + string_2 + '&' + string_3 + 'E';
char char_buf[40];
string_outData.toCharArray(char_buf, 50);
Serial.write(char_buf);
string_outData = 'a' + string_1 + '&' + string_2 + '&' + string_3 + 'E';
char char_buf[40];
string_outData.toCharArray(char_buf, 50);
Serial.write(char_buf);
To copy to clipboard, switch view to plain text mode
In QT, I want to receive the chars and build a string:
ui->recv_text->append(incoming_string);
QString incoming_string = QString::fromLatin1(port->readLine());
ui->recv_text->moveCursor(QTextCursor::End);
ui->recv_text->append(incoming_string);
To copy to clipboard, switch view to plain text mode
This works fine so far - but this is a QTextEdit and not a string. In the QTextEdit I do not get 1 Line with the whole string, but this:
XXX // 3 chars
XXXX // 4 chars. ... why?
XXXX
XXXX
XX
instead of:
XXXXXXXXXXXXXXXXXXXXXXXX
What I want to get is the whole content of what is char_buf at the Arduino in incoming_string in the QT5 GUI. But I am failing miserably so far. I want to seperate the incoming_string later so I am able to work with the three strings. Please, I am very much in need of input How can I get a perfectly fine string ?
Bookmarks