int qRegisterMetaType ( const char * typeName )
Registers the type name typeName for the type T. Returns the internal ID used by QMetaType. Any class or struct that has a public default constructor, a public copy constructor and a public destructor can be registered.
After a type has been registered, you can create and destroy objects of that type dynamically at run-time.
This example registers the class MyClass:
qRegisterMetaType<MyClass>("MyClass");
Note: This function is thread-safe.
See also qRegisterMetaTypeStreamOperators(), QMetaType::isRegistered(), and Q_DECLARE_METATYPE().
Partager