use a QSharedPointer to allow for more elegant assignment cleanup

- closes #2554