PDA

View Full Version : QByteArray to QUuid



chandan
10th August 2010, 11:18
Hi Everyone,
Can anyone help me to find out the way of converting QByteArray to QUuid please?

Thanks,
Chandan

chandan
10th August 2010, 12:04
Hi,
I got the solution. I am adding the solution in here for the other if anyone face the same problem in the future,

QByteArray ByteArray;
QString StringTemp = pByteArrayImageDatabaseUUID[0].toHex().data();
StringTemp.insert(8,QString("-"));
StringTemp.insert(13,QString("-"));
StringTemp.insert(18,QString("-"));
StringTemp.insert(23,QString("-"));
StringTemp.insert(36,QString("}"));
StringTemp.insert(0,QString("{"));
QUuid UuidUser(StringTemp);

Lykurg
10th August 2010, 12:06
How does the value of your QByteArray look like? And QUuid provides different constuctors:
QUuid ( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
QUuid ( const QString & text )

EDIT: too late.

chandan
10th August 2010, 12:11
Thanks anyway.