[Qt-interest] QMetaType::type succeeds or fails seemingly

Thiago Macieira thiago at kde.org
Fri Sep 30 11:34:58 CEST 2011


On Friday, 30 de September de 2011 08:40:20 Schimkowitsch Robert wrote:
> I can't use qRegisterMetaType<MyType>(), because I don't know the type
> at compile time.

You do know it before you place the type in the variant. Somewhere you had to 
have the original type. QMetaType is enough to copy, create and delete such 
types, but if this is all you do with them, maybe you should simply delete the 
code.

> The type is defined inside a library, and I only get it by iterating
> through the properties of a QObject-based class defined within that
> library.

The library should register the type.

> What would really help me would be some method I could call on the
> QObject that would ensure all DECLARE_METATYPE enums related to that
> object are resolved.

Feature request for moc.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110930/51726eef/attachment.bin 


More information about the Qt-interest-old mailing list