[Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

Thiago Macieira thiago.macieira at intel.com
Sat Sep 26 17:43:53 CEST 2020


On Saturday, 26 September 2020 07:53:23 PDT Alexander Dyagilev wrote:
> template <class T>
> inline void qRegisterMyMetaType(const char *name)
> {
>      if (QMetaType::type(name) == QMetaType::UnknownType)
>          qRegisterMetaType<T>(name);
> }

Better implementation:

template <class T>
inline void qRegisterMyMetaType(const char *name)
{
    Q_UNUSED(name);
    qRegisterMetaType<T>();
}

#define Q_REGISTER_MY_METATYPE Q_DECLARE_METATYPE

This checks that whether the type is already registered without making a 
function call.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Interest mailing list