I've seen How to verify QVariant of type QVariant::UserType is expected type? and I understand how to tell that an object of class MyType has been stored in a QVariant object. I've read the documentation for QVariant::convert () but I don't follow how I call a member function defined in MyType for an object that I have received as a QVariant.
Say I have
class MyType
{
public:
void myFunction;
.
.
.
};
Q_DELCARE_METATYPE(MyType)
MyType m;
QVariant var (QVariant::fromValue (m));
How do I call MyType::myFunction for the MyType object saved at var?