Reputation: 1020
I have a DATA_BLOB structure but I need to convert it to QString. How can I do this?
Upvotes: 1
Views: 7020
Reputation: 7064
BYTE* pu8_RawData = (BYTE*)i_RawData.parray->pvData;
DWORD u32_RawLen = i_RawData.parray->rgsabound[0].cElements;
qDebug() << QString(QByteArray((const char*) pu8_RawData, (int)u32_RawLen));
Upvotes: 0
Reputation: 14327
BYTE* myByteBlob;
int myByteBlobSize;
// Get the blob, find out the size.
// ...
QString myString( QByteArray( myByteBlob, myByteBlobSize));
Upvotes: 0
Reputation: 14446
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
Upvotes: 1