QPointer is not meant for return values. There are also performance considerations to avoid returning QPointer.