Solved Unsigned char to QString
-
Hello i was checking the functions of QString most of them work with const char parameters.
I tried google and not found a solution for this, i tried ones but wasn't successful.
I have this
. . . . . unsigned char *datarx = new unsigned char[4]; //data to read QString data; for (int n=0;n<4;n++) { data=(QChar(datarx[n])); } . . . . .
-
So what you want to achieve?
-
@Eeli-K said in Unsigned char to QString:
So what you want to achieve?
I want to display that array in a listWidget i usually do this
QString error="no recive successful"; ui->listWidget->addItem(error);
-
QString data( reinterpret_cast< char* >( datarx ) );