QString to QByteArray problem.
Unsolved
General and Desktop
-
I want to sending data by UART communication.
So add below code.QByteArray send_data;
QString value = "100000000";
send_data = value.toUtf8();
port->write(send_data.data());In this case, when data receiving occured fail.
But if setting the value variable as "10000000"
The result is success. data receiving is success.How can I solve this problem???
-
Hi,
No need for QString to be involved in this case.
port->write("100000000");
should be enough.