Qt: dynamic widgets signal and slot connection

后端 未结 2 586
借酒劲吻你
借酒劲吻你 2020-12-20 01:27

In my Qt app, I create some of my widgets dynamically. Among them are QToolButtons that need to have a similar behavior.

Here is how the widgets are created:

2条回答
  •  一向
    一向 (楼主)
    2020-12-20 02:31

    Use QObject::sender() inside your slot to get the Sender. It will return the object that emit the signal. hope this helps.

提交回复
热议问题