When more than one relation is used, an internal container might be
resized which can lead to a reallocation. Since the internal data
structure holds a pointer to an element of this container, this pointer
is invalidated after the reallocation. Therefore store a QSharedPointer
instead.
Pick-to: 6.7 6.5
Fixes: QTBUG-60674
Change-Id: I18c6157c7328be201f8b89a7ca12f423a86d9b71
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c0aabbd8a0c5a01c2048bcaf36525570a8e0bb35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>