You can use the C++ RTTI (Run Time Type Identification) mechanism if your compiler and C++ library supports it; some don't. See 'typeid' for starters. You can also use dynamic_cast<>, or the Qt-provided qobject_cast<>, to compare the type of your pointers with known types to see if they're the same.