Search code examples
c++qtstatic-analysissignals-slots

How can I do a check of the signal/slot connect's during compilation?


Checking the Qt signal slot connect calls at runtime is a worry for me. I should be possible to run a static check of the connect statements.

Does such a tool exist?


Solution

  • Using QT5 you can use the following syntax which is statically checked at compile time:

    connect(sender, &Sender::signalMethod,  receiver, &Receiver::slotMethod);