2016-10-05 75 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