Q_DECLARE_METATYPE_TEMPLATE_3ARG missing
-
Hi,
Can you show the code for your use case ?
By the way, which version of Qt are you using ?
-
OK. disregard, in the end it was NOT needed. But what if I want a custom templated type with more than 2 arguments to be recognized by QVariant : e.g.
template<typename A, typename B, typename ...C>
MyClass{};can I just use Q_DECLARE_METATYPE to make it visible to the moc
? -
OK. disregard, in the end it was NOT needed. But what if I want a custom templated type with more than 2 arguments to be recognized by QVariant : e.g.
template<typename A, typename B, typename ...C>
MyClass{};can I just use Q_DECLARE_METATYPE to make it visible to the moc
?@pip010 said in Q_DECLARE_METATYPE_TEMPLATE_3ARG missing:
template<typename A, typename B, typename ...C> MyClass{};
This is not a class, it's a template for a class. Before you fully specialize that template, there's nothing really to serialize/deserialize. The macro you mention is for internal use (I strongly suspect), to enable serialization of vector/lists and maps/hashes. Anyway, you should use
Q_DECLARE_METATYPE
.