Hi all,
I read the documentation about QVariant with the little example that I report here:

Qt Code:
  1.  
  2. MyCustomStruct c;
  3. if (v.canConvert<MyCustomStruct>())
  4. c = v.value<MyCustomStruct>(v);
  5.  
  6. v = 7;
  7. int i = v.value<int>(); // same as v.toInt()
  8. QString s = v.value<QString>(); // same as v.toString(), s is now "7"
  9. MyCustomStruct c2 = v.value<MyCustomStruct>(); // conversion failed, c2 is empty
To copy to clipboard, switch view to plain text mode 

From this, I understand that I can initialize a QVariant variable only with data types supported by QVariant itself. Am I right?
Is there a way to initialize the variable v with a custom type?

Thanks for your anwers!
Alex