1. 识别问题类型 这个问题是关于Qt框架中QObject::connect函数的使用。QObject::connect是Qt中用于连接信号和槽的重要函数,它允许对象在特定事件发生时自动调用另一个对象的函数。 2. 分析错误原因 错误信息“cannot queue arguments of type 'uint8_t'”表明Qt无法将uint8_t类型的参数放入队列中。
在Manager的头文件中,引入: #include<QMetaType> 然后在Manager的构造函数最开始的地方添加: qRegisterMetaType
如上:connect(m_pSerialTTyWK2,SIGNAL(SendComDataArrivedSignal(QByteArray&)),this,SLOT(OnRecvdTTyWK2Data(QByteArray&))); 是从子线程 发串口数据到主线程,主线程的槽确收不到。会有个提示:QObject::connect: Cannot queue arguments of type 'QByteArray&' (Make sure 'QByteArray&' is registered usi...
QObject::connect: Cannot queue arguments of type 'QMap<QString,QString>',(Make sure 'QMap<QString,QString>' is registered using qRegisterMetaType().). 上述错误,只有在跨线程信号传递时才会出现. 因为QMap是QT可识别的基本类型,不需要再注册元对象系统中,在同一个线程中运行没有问题. 源码: // 线程...
QObject::connect: Cannot queue arguments of type ‘QSerialPort::SerialPortError’ (Make sure ‘QSerialPort::SerialPortError’ is registered using qRegisterMetaType().) 2 解决方法 这个其实就一句话,那就是在函数调用前注册了就可以,代码如下
QOBject::connect:Cannot queue arguments of type 'MoSystemLog' (Make sure 'MoSystemLog' is registed using qRegisterMetaType().) 意思是说,信号槽队列中的数据类型必须是系统能识别的元类型,不然得用qRegisterMetaType()进行注册。 二、解决方法:
Qt解决:Qobject::connect queue arguments of type ‘xxxx’,Make sure ‘xxxx’ is registered using qRegister 2019-01-22 10:45 −解决方法:在调用connect之前,通过 qRegisterMetaType() 注册你connect函数里对象的类型代码如下: typedef QString CustomString;//你自己定义的类型 qRegisterMetaType<CustomString>(...
MainWindow类使用AddressWidget作为其中心小部件,并提供文件和工具菜单。(与官方示例不同的地方是:Main...
QObject::connect: Cannot queue arguments of type 'MyType' (Make sure 'MyType' is registered using qRegisterMetaType().) make sure to declare the argument type with Q_DECLARE_METATYPE Note: This function is thread-safe. QMetaObject::Connection QObject::connect(const QObject * sender, Pointer...
QObject::connect: Cannot queue arguments of type 'QTextCursor'(Make sure 'QTextCursor' is registered using qRegisterMetaType().) 【解决】 我们不能通过线程来修改UI,较为安全的修改用户界面的方式是向UI窗口发送信号(signal),较为简单的方式是使用 Qt threading 1 2 3 4 5 6 7 8 9 10 11 12 13...