Commit 6d61277d authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesginer.contextPane: fix rewriting/undo stack

parent 96cb6d00
......@@ -175,7 +175,6 @@ void QmlContextPane::setProperty(const QString &propertyName, const QVariant &va
QTextCursor tc(m_editor->editor()->document());
tc.beginEditBlock();
int cursorPostion = tc.position();
tc.beginEditBlock();
changeSet.apply(&tc);
if (line > 0) {
......@@ -191,9 +190,6 @@ void QmlContextPane::setProperty(const QString &propertyName, const QVariant &va
}
tc.endEditBlock();
tc.setPosition(cursorPostion);
tc.endEditBlock();
tc.setPosition(cursorPostion);
}
}
......@@ -246,8 +242,14 @@ void QmlContextPane::onPropertyRemovedAndChange(const QString &remove, const QSt
if (!m_doc)
return;
setProperty(change, value);
QTextCursor tc(m_editor->editor()->document());
tc.beginEditBlock();
removeProperty(remove);
setProperty(change, value);
tc.endEditBlock();
m_doc.clear(); //the document is outdated
}
......
Markdown is supported
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