Commit 0fa50d92 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: start transactions

parent 981ce880
...@@ -475,11 +475,10 @@ void GradientLine::deleteGradient() ...@@ -475,11 +475,10 @@ void GradientLine::deleteGradient()
if (m_itemNode.isInBaseState()) { if (m_itemNode.isInBaseState()) {
if (modelNode.hasProperty(m_gradientName)) { if (modelNode.hasProperty(m_gradientName)) {
RewriterTransaction transaction; RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction();
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();
/*ModelNode gradientNode = modelNode.nodeProperty(m_gradientName).modelNode();
if (QmlObjectNode(gradientNode).isValid()) if (QmlObjectNode(gradientNode).isValid())
QmlObjectNode(gradientNode).destroy();*/ QmlObjectNode(gradientNode).destroy();
} }
} }
} }
...@@ -662,7 +661,7 @@ void GradientLine::updateGradient() ...@@ -662,7 +661,7 @@ void GradientLine::updateGradient()
{ {
if (!active()) if (!active())
return; return;
RewriterTransaction transaction; RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction();
if (!m_itemNode.isValid()) if (!m_itemNode.isValid())
return; return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment