Use QPointer instead of QWeakPointer.