QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError'
-
As the title suggests. I am getting this message in my output, from a serial port that is called from an object operating in a different thread. The object is called via signals and slots. Sadly I have yet to determine which exact line of code is giving this message.
QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError' (Make sure 'QSerialPort::SerialPortError' is registered using qRegisterMetaType().)I have a few questions. Firstly, what does it mean that QSerialPort::SerialPortError can't be queued? Secondly, is this a problem that actually matters? Thirdly, what is qRegisterMetaType()? Fourthly, what does it mean to register QSerialPort::SerialPortError using qRegisterMetaType()?
Please let me know if more information is required.
-
As the title suggests. I am getting this message in my output, from a serial port that is called from an object operating in a different thread. The object is called via signals and slots. Sadly I have yet to determine which exact line of code is giving this message.
QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError' (Make sure 'QSerialPort::SerialPortError' is registered using qRegisterMetaType().)I have a few questions. Firstly, what does it mean that QSerialPort::SerialPortError can't be queued? Secondly, is this a problem that actually matters? Thirdly, what is qRegisterMetaType()? Fourthly, what does it mean to register QSerialPort::SerialPortError using qRegisterMetaType()?
Please let me know if more information is required.
@Dummie1138 said in QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError':
Sadly I have yet to determine which exact line of code is giving this message.
Most likely your
connectstatement.what does it mean that QSerialPort::SerialPortError can't be queued?
In order to send signals using
QSerialPort::SerialPortErroras argument in your thread, you need to register it in your class.// before the first connect with SerialPort qRegisterMetaType<QSerialPort::SerialPortError>("YourThreadCLass");is this a problem that actually matters?
You cant include your type in your signal otherwise.
what is qRegisterMetaType()?
Therefore, read what
QMetaTypeis.what does it mean to register QSerialPort::SerialPortError using qRegisterMetaType()?
Your type
<T>, whatever it might be, is a recognisedMetaObjectand can be used in further queued connections.
A Signal & Slot connection across threads is always a queued connection, or should be. Unspecified in your statement, it will pick the right one (Direct- vs. QueuedConnection) for you.