views:

94

answers:

2

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
Is it possible to convert BYTE* to QString without explicit conversion to const char*?
SKINDER
I do not know any way to convert from BYTE* to QString without excplictly cast to const char*
Patrice Bernassola
A: 
BYTE* myByteBlob; 
int myByteBlobSize;

// Get the blob, find out the size.
// ...

QString myString( QByteArray( myByteBlob, myByteBlobSize));
Cătălin Pitiș
I suppose I must explicitly convert BYTE* to const char* to use this solution...
SKINDER
Probably yes...
Cătălin Pitiș