Declare structs as metatype
-
Hi,
I try run below code:struct userDetails { QString description; QString userEmail; QString comment; }; struct companyDetails { QString name; QString address1; QString address2; QString address3; }; Q_DECLARE_METATYPE(userDetails) Q_DECLARE_METATYPE(companyDetails)But I have errors:
networkworker.h:78:5: Class template specialization of 'QMetaTypeId' must occur at global scope qmetatype.h:1768:8: explicitly specialized declaration is hereWhere I should use my code ?
-
Probably I should use
Q_DECLARE_METATYPEoutside my class:Q_DECLARE_METATYPE(MyClass::userDetails) Q_DECLARE_METATYPE(MyClass::companyDetails) -
Probably I should use
Q_DECLARE_METATYPEoutside my class:Q_DECLARE_METATYPE(MyClass::userDetails) Q_DECLARE_METATYPE(MyClass::companyDetails)@Damian7546 Did it work? I think the form you write was declaring as Namespace::Struct, not Struct::struct.