Try using QMetaObject::invokeMethod
:
void ManyThings::makeThingDoSomething(int thingIndex) {
QMetaObject::invokeMethod(things_[thingIndex], "doSomething",
Qt::AutoConnection);
}
Note that doSomething
will likely have to remain a slot if you use this approach.