As a workaround you can call the Q_DECLARE_METATYPE
macro from the implementation files that need it instead of calling it from the header files, or as the documentation suggests, call it from private headers in each library.
But because QUuid
stores its content as a QByteArray
which is already supported by QVariant
, you don't need to use Q_DECLARE_METATYPE
to do that (from Qt 4.8 only):
// QVariant variant;
// QUuid uuid;
variant = uuid.toByteArray();
uuid = variant.toByteArray();
or the same thing, but a little less efficiently, with QString
(before Qt 4.8):
variant = uuid.toString();
uuid = variant.toString();
And since QVariant
will implicitly convert between QString
and QByteArray
, you can mix toString
and toByteArray
without any problem.