Qt World Summit: Submit your Presentation

Checking signal if it was emitted?

  • Hi,
    If there is any way to check if signal was emitted? I want to do this because I have signal-slot connection and it doesn't work - as if signal wasn't emitted. Signal is from library and then my slot should work but it's not.
    Or is there something to checking emitting signals?

  • If all conditions are met for the path where the signal should be emitted it is.
    What you can try is

    • Check connect is called before the signal is emitted
    • Check whether the connect returns true or not
    • If you use custom types check if they are registered as meta type

  • You can also:

    • Debug into the emit statement, and see where it goes
    • Attach a QSignalSpy and check the list of emitted signals

Log in to reply