Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt QObject connect:无法对类型为';QItemSelection';_Qt_Signals Slots - Fatal编程技术网

Qt QObject connect:无法对类型为';QItemSelection';

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

我在第二天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 '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()的顶部。