Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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.


  • Lifetime Qt Champion

    Hi,

    How are you getting these hardware signals to your application ?



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



  • 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



  • @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?


Log in to reply