2D: Use loadFromModule instead of setData


Using QQmlComponent::setData is problematic in a code where the same
type is created again and again since the created QQmlTypeData is not
cached. QGraphsView uses it in componentComplete to create zoom area so
if multiple graphsviews are created, the engine allocates space for
every graphsview's zoom areas. This patch changes Graph2D to use
QQmlComponent::loadFromModule rather than QQmlComponent::setData.

Task-number: QTBUG-142559
Change-Id: I1d59ed99a22fd57235af5603f991865be1e6d3c9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
commit6adf6a4b4668dc817cf7e8c2c582b1a46c5e0de4
parent5e8c18e299ad60a2d1183fab92052e5edb70b739
authorSami Varanka <sami.varanka@qt.io>
committerSami Varanka <sami.varanka@qt.io>
commit timeTue, 19 May 2026 09:10:08 +0000