Hi to all,
reading the documentation seems easy but I can not convert a QByteArray to a QVariantList.
I know that first I have to convert it to a QVariant and then I append to a QVariantList.

I wrote this code:
in my class declaration I have

Qt Code:
  1. class UserData
  2. {
  3. public:
  4. QByteArray m_fpData;//352bytes
  5. QByteArray& fingerData(){ return m_fpData; }
  6.  
  7. ..more code..
  8. }
To copy to clipboard, switch view to plain text mode 

and in a method of another class I have

Qt Code:
  1. bool Device::registerNewUser(UserData* user)
  2. {
  3. QList<QVariant> paramList;
  4.  
  5. //cardId
  6. QString cardId = QString::number( user->cardId(), 10 );
  7.  
  8. //fp data
  9. QByteArray& b = user->fingerData(); //I get the reference to the bytearray
  10. v.setValue(b); //I add it to a QVariant
  11. QVariantList fingerData;
  12. fingerData.append(v); //and finally to a QVarianList
  13. ...more code...
  14.  
  15. }
To copy to clipboard, switch view to plain text mode 


Unfortunately I get invalid pointer of the QVariant. This is strange to me as from documentation of QVariant a QVariant accept a reference to a QByteArray as constructor:
Qt Code:
  1. QVariant::QVariant ( const QByteArray & val )
  2. Constructs a new variant with a bytearray value, val.
To copy to clipboard, switch view to plain text mode 


So I don't know how to solve my problem