I want to connect all signals of one QObject to a certain slot.
The slot looks something like this:
void SignalIntercepter::signalFired()
{
std::cout << "Signal is fired!" << std::endl;
}
The following code is where the QObject will be passed to:
void SignalIntercepter::handleObject(QObject* object)
{
const QMetaObject *me = object->metaObject();
int methodCount = me->methodCount();
for(int i = 0; i < methodCount; i++)
{
QMetaMethod method = me->method(i);
if(method.methodType() == QMetaMethod::Signal)
{
// How do I connect this signal to the slot?
// QObject::connect(object, ..., ..., ...);
}
}
}