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. How can i know which signal come first among three signal?
Forum Updated to NodeBB v4.3 + New Features

How can i know which signal come first among three signal?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 943 Views 1 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.
  • Y Offline
    Y Offline
    Yash001
    wrote on last edited by
    #1

    My software is connected with hardware. Hardware send three different signal through USB. I captures that signal into software.

    How can I identify, which signal come first on software side?

    I have three slot for three signal. One slot per each signal.

    Qt has any class, which is give the information about signal order? or any C++ design pattern, which I can use to identify the signal order?

    That three signal some many time from hardware. I wanted to find the order when it is come first time only.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      How are you getting these hardware signals to your application ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        You could record time when you receive signal and then add it to some treeView & sort it by time?

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #4

          Are you using multiple threads?
          If the answer is no then the order of execution of the slots is guaranteed to be the order of emission of the signal.*
          If multiple slots are connected to the same signal they will executed in the order they were connected**

          Sources:
          '* http://doc.qt.io/qt-5/qt.html#ConnectionType-enum direct connection is equivalent to a call direct call to the slot, even if you force the queued connection signals invoke QCoreApplication::postEvent which is a FIFO queue
          ** http://doc.qt.io/qt-5/signalsandslots.html#signals

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          JonBJ 1 Reply Last reply
          4
          • VRoninV VRonin

            Are you using multiple threads?
            If the answer is no then the order of execution of the slots is guaranteed to be the order of emission of the signal.*
            If multiple slots are connected to the same signal they will executed in the order they were connected**

            Sources:
            '* http://doc.qt.io/qt-5/qt.html#ConnectionType-enum direct connection is equivalent to a call direct call to the slot, even if you force the queued connection signals invoke QCoreApplication::postEvent which is a FIFO queue
            ** http://doc.qt.io/qt-5/signalsandslots.html#signals

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @VRonin
            I'm sure your two statements are true, but since they are pretty significant can you provide documentation links for each of them (especially the first), please?

            1 Reply Last reply
            1

            • Login

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