How Qt would guess which of my 4 custom types I want it to be?
It can't - that's the whole point. C++ (not Qt) also cannot know what sort of derived class you're going to drop into the tree, so it stores all derived classes as a pointer to base object. It's YOUR responsibility to know what's in there and cast it to the correct type, or use whatever idiom for doing something similar is available in Python.