From eae9be421826e78ed567123ef85c2b3cdaba1b1a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 15 Nov 2022 11:53:39 +0200 Subject: [PATCH] QmlDesigner: Unify state handling on puppet reset Form editor and 3D edit view changed state to base before issuing reset, and form editor also changed it back to current state after issuing reset, while all other resetPuppet calls do not change state. Since puppet reset is asynchronous with small delay, the state changes done by form editor did essentially nothing, and just changing to base state in 3D edit view is wrong as we don't want reset to change the state. Removed state changes from puppet resets to unify the reset functionality. Fixes: QDS-8253 Change-Id: I33be3ec864ffb972010e25c2fb956695201db9ec Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/edit3d/edit3dview.cpp | 2 -- .../qmldesigner/components/formeditor/formeditorview.cpp | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp index 2159c3c9ee8..6098e49fbcf 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp @@ -627,7 +627,6 @@ void Edit3DView::createEdit3DActions() m_particlesPlayAction->action()->setChecked(true); if (m_seeker) m_seeker->setEnabled(false); - setCurrentStateNode(rootModelNode()); resetPuppet(); }; @@ -638,7 +637,6 @@ void Edit3DView::createEdit3DActions() if (m_seeker) m_seeker->setEnabled(false); QmlDesignerPlugin::settings().insert("particleMode", particlemode); - setCurrentStateNode(rootModelNode()); resetPuppet(); }; diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index f25c3b0af11..a95af3f334a 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -858,10 +858,7 @@ bool FormEditorView::isMoveToolAvailable() const void FormEditorView::resetNodeInstanceView() { - ModelNode currentStateNode = currentState().modelNode(); - setCurrentStateNode(rootModelNode()); resetPuppet(); - setCurrentStateNode(currentStateNode); } void FormEditorView::addOrRemoveFormEditorItem(const ModelNode &node)