2016-10-05 77 views

回答

0

是的,这是可能的。 您可以通过简单的做到这一点写一个连接语句为每个信号要发送到您的插槽,如:

connect(thread_notification, SIGNAL(signal1()), this, SLOT(slot())); 
connect(thread_notification, SIGNAL(signal2()), this, SLOT(slot())); 
... 
connect(thread_notification, SIGNAL(signalN()), this, SLOT(slot())); 

的另一种方式,你可以遵循,尤其是在信号发件人是数组,列表,或在一般而言,对象的容器是使用QSignalMapper,但它取决于谁发送和发送什么信号。你可以在这里找到一个explenation http://doc.qt.io/qt-4.8/qsignalmapper.html