PDA

View Full Version : QVariant to QString (binary)



8080205
9th October 2012, 11:25
Hello guys,

i have in hands a basic problem.


Variable attributeValue is QVariant.

QByteArray value;
for(int i=0;i<(int)attribute.ulValueLen;i++)
value.append(((quint8*)attribute.pValue)[i]);
attributeValue.setValue(value);

After this code i want put in one std::string the attributeValue.

QByteArray is a binary?

Thanks.

Regards,

8080205

Santosh Reddy
9th October 2012, 12:22
Ok just put QString in QVariant, what is stopping you? I mean what is the problem in doing so?