The cached objects can be deleted, so keep them in a QPointer.

Change-Id: Ieaebd2e7b9823cbe22efc331e42ceab8fbbda0e8
Task-number: QTBUG-40201
Reviewed-by: Lars Knoll <lars.knoll@digia.com>