Qt QObject connect:无法对类型为';QItemSelection';
我在第二天23:59:59的时候收到了以下消息。 我不知道(因为代码是别人写的)它来自哪里。 有人能建议如何找出这个问题吗? 谢谢Qt QObject connect:无法对类型为';QItemSelection';,qt,signals-slots,Qt,Signals Slots,我在第二天23:59:59的时候收到了以下消息。 我不知道(因为代码是别人写的)它来自哪里。 有人能建议如何找出这个问题吗? 谢谢 QObject::connect: Cannot queue arguments of type 'QItemSelection' (Make sure 'QItemSelection' is registered using qRegisterMetaType().) QObject::connect: Cannot queue arguments of type
QObject::connect: Cannot queue arguments of type 'QItemSelection'
(Make sure 'QItemSelection' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QItemSelection'
(Make sure 'QItemSelection' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QItemSelection'
(Make sure 'QItemSelection' is registered using qRegisterMetaType().)
在命名空间外部使用以下命令:
Q_DECLARE_METATYPE(namespace::QItemSelection)
在命名空间之外使用以下内容:
Q_DECLARE_METATYPE(namespace::QItemSelection)
这可能就是问题所在,否则qRegisterMetaType()将无法编译。我想缺少的是qRegisterMetaType()调用本身。执行qRegisterMetaType();在它被这样使用之前,例如在main()之上。这可能就在那里,因为qRegisterMetaType()否则不会编译。我想缺少的是qRegisterMetaType()调用本身。执行qRegisterMetaType();在使用之前,例如在main()的顶部。