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 _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest