There are at least 2 ways. First, disconnect everything.
disconnect(obj,0,0,0);
//or
obj->disconnect();
Second. Every connect() returns QMetaObject::Connection which can be copied or moved, so you can save some connections in the list and after some time, just iterate through the list and call disconnect() for every object. Example with one connection:
QMetaObject::Connection m_connection;
//…
m_connection = QObject::connect(…);
//…
QObject::disconnect(m_connection);
Bonus: no, Qt doesn't support such deep introspection, you can't get list of all connected slots or something another, but in most cases, you don't need this at all. One useful info, that Qt gives you is sender(), pointer to object that sent signal.
https://wiki.qt.io/New_Signal_Slot_Syntax
https://stackoverflow.com/questions/32124715/is-it-possible-to-disconnect-all-of-a-qobjects-connections-without-deleting-it
There are at least 2 ways. First, disconnect everything.
disconnect(obj,0,0,0); //or obj->disconnect(); Second. Every connect() returns QMetaObject::Connection which can be copied or moved, so you can save some connections in the list and after some time, just iterate through the list and call disconnect() for every object. Example with one connection:
QMetaObject::Connection m_connection; //… m_connection = QObject::connect(…); //… QObject::disconnect(m_connection); Bonus: no, Qt doesn't support such deep introspection, you can't get list of all connected slots or something another, but in most cases, you don't need this at all. One useful info, that Qt gives you is sender(), pointer to object that sent signal.