[Interest] how can I call qRegisterMetaType?
Thiago Macieira
thiago.macieira at intel.com
Mon May 16 17:27:30 CEST 2016
On segunda-feira, 16 de maio de 2016 13:28:09 PDT Nye wrote:
> > Should I just do it from the constructor?
>
> That would be what I usually do. Still there's overhead of repeatedly
> registering the same type, so if you have a better place on hand (a root
> object/entry point of your application/library) that'd be better.
The overhead is almost null because the inline parts of qRegisterMetaType
function check whether it's already registered before calling the non-inline
parts.
PS: DO NOT use the qRegisterMetaType overload with 1 argument. Use the one
with zero.
> > Would I need to worry about thread safety then, if my class was created in
> > a bunch of threads at the same time while this is going on?
>
> qRegisterMetaType is thread-safe.
>
> Kind regards,
> Konstantin.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list