Changed QWeakPointer to QPointer to fix qt5 compilation error