diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.cpp index 4260921a378..046dc486063 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.cpp @@ -142,6 +142,16 @@ void CameraGeometry::doUpdateGeometry() if (!QQuick3DObjectPrivate::get(m_camera)->spatialNode) { // Doing explicit viewport mapping forces cameraNode creation m_camera->mapToViewport({}, m_viewPortRect.width(), m_viewPortRect.height()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + if (!m_nodeCreationUpdateDone) { + // Post-node creation update is done only once to avoid infinite loop in case the node + // creation fails. + m_nodeCreationUpdateDone = true; + m_cameraUpdatePending = true; + update(); + return; + } +#endif } GeometryBase::doUpdateGeometry(); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.h index 5b4fa66fe46..c65b0d1798e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/camerageometry.h @@ -67,6 +67,9 @@ private: QQuick3DCamera *m_camera = nullptr; QRectF m_viewPortRect; bool m_cameraUpdatePending = false; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + bool m_nodeCreationUpdateDone = false; +#endif }; }