Important: Please read the Qt Code of Conduct -

Avantages of subclassing Events over defining new Signals and slots

  • Is there any advantage of using custom events over using custom signals and slots. I usually go for the signal and slots, because I took this habit from the beginning of my Qt experience. Is there any advantage in code style, performance ,architecture design (or anything else) of using custom events over signals and slots?? When does sub-classing events more appropriate than creating signals and slots?

  • Hello!

    I think there are no advantages or disadvantages. Each one has its own purpose.

    This is from Qt4 programming book:

    bq. Copyright (c) 2006 by Jasmin Blanchette and Mark Summerfield. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at
    "...Qt widgets emit signals when something significant occurs. Events become useful when we write our own custom widgets or when we want to modify the behaviour of existing Qt widgets." Chapter 7, page 163.

    Hope this answers your question.


Log in to reply