From 0fa50d922ec95d40e67e1c3900ba5e3782c81a4d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Mon, 19 Apr 2010 15:27:21 +0200 Subject: [PATCH] QmlDesigner.propertyEditor: start transactions --- .../components/propertyeditor/colorwidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp index a35f7523fcb..e3310584610 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp @@ -475,11 +475,10 @@ void GradientLine::deleteGradient() if (m_itemNode.isInBaseState()) { if (modelNode.hasProperty(m_gradientName)) { - RewriterTransaction transaction; - m_itemNode.modelNode().removeProperty(m_gradientName); //### there is atm a bug in the node instances which lead to a crash if using destroy() - /*ModelNode gradientNode = modelNode.nodeProperty(m_gradientName).modelNode(); + RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction(); + ModelNode gradientNode = modelNode.nodeProperty(m_gradientName).modelNode(); if (QmlObjectNode(gradientNode).isValid()) - QmlObjectNode(gradientNode).destroy();*/ + QmlObjectNode(gradientNode).destroy(); } } } @@ -662,7 +661,7 @@ void GradientLine::updateGradient() { if (!active()) return; - RewriterTransaction transaction; + RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction(); if (!m_itemNode.isValid()) return; -- GitLab