您可以使用static_cast将任何指向T的指针转换为/从void*,那么为什么Qt使用reinterpret_cast呢?
int SOME_OBJECT::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
// Why reinterpret_cast here??
case 0: on_tabWidget_tabCloseRequested((*reinterpret_cast< int(*)>(_a[1]))); break;
default: ;
}
_id -= 1;
}
return _id;
}
moc
生成的,对吗? - aschepler