QmlDesginer.contextPane: fix rewriting/undo stack

This commit is contained in:
Thomas Hartmann
2010-07-09 15:53:00 +02:00
parent 96cb6d009e
commit 6d61277d84

View File

@@ -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
}