What are the differences between event and signal in Qt

后端 未结 4 1996
一整个雨季
一整个雨季 2020-12-28 15:56

It is hard for me to understand the difference between signals and events in Qt, could someone explain?

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-28 16:33

    Events are something that happened to or within an object. In general, you would treat them within the object's own class code.

    Signals are emitted by an object. The object is basically notifying other objects that something happened. Other objects might do something as a result or not, but this is not the emitter's job to deal with it.

提交回复
热议问题