Returning void* in C++ is a bad idea. Return QVariant instead. Since QVariant also includes QVariantHash, you'll be able to return every type you need. And you can register custom types with QVariant as well.