Register a named type in the meta object system

From qtnode

Jump to: navigation, search

You can register a type in the meta object system either at compile-time or run-time.

For instance if you had an object named SomeType and you needed to register it (maybe you are passing is as a parameter to a queued slot)...

To register the type at run-time:

qRegisterMetaType<SomeType>("SomeType");

To register the type at compile-time:

Q_DECLARE_METATYPE(SomeType);

Links:

Personal tools