I have a DATA_BLOB structure but I need to convert it to QString. How can I do this?
+1
A:
You can use the QString
constructor with a QByteArray
parameter.
You can use too the constructor with the const char*
parameter too
Hope that helps
Patrice Bernassola
2010-09-07 12:08:31
Is it possible to convert BYTE* to QString without explicit conversion to const char*?
SKINDER
2010-09-07 13:18:49
I do not know any way to convert from BYTE* to QString without excplictly cast to const char*
Patrice Bernassola
2010-09-07 13:40:55
A:
BYTE* myByteBlob;
int myByteBlobSize;
// Get the blob, find out the size.
// ...
QString myString( QByteArray( myByteBlob, myByteBlobSize));
Cătălin Pitiș
2010-09-07 12:41:53
I suppose I must explicitly convert BYTE* to const char* to use this solution...
SKINDER
2010-09-07 13:14:44