Or you never put a Foo* in the QModelIndex through your createIndex() calls.