Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError'
Forum Updated to NodeBB v4.3 + New Features

QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError'

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 622 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dummie1138D Offline
    Dummie1138D Offline
    Dummie1138
    wrote on last edited by
    #1

    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.

    Pl45m4P 1 Reply Last reply
    0
    • Dummie1138D Dummie1138

      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.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @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 connect statement.

      what does it mean that QSerialPort::SerialPortError can't be queued?

      In order to send signals using QSerialPort::SerialPortError as 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 QMetaType is.

      • https://doc.qt.io/qt-6/qmetatype.html#details

      what does it mean to register QSerialPort::SerialPortError using qRegisterMetaType()?

      Your type <T>, whatever it might be, is a recognised MetaObject and 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.

      • https://doc.qt.io/qt-6/qmetatype.html#qRegisterMetaType-2

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved