Qt编译报错QObject::connect: Cannot queue arguments of type ‘xxxxxx‘

Qt程序中报错QObject::connect: Cannot queue arguments of type 'QVector' (Make sure 'QV

Qt程序中报错QObject::connect: Cannot queue arguments of type 'QVector' (Make sure 'QVector' is registered using qRegisterMetaType().

原因是因为在线程间QVector没有注册。

在代码中加入

qRegisterMetaType>("QVector");

再次编译,即可。