forked from qt-creator/qt-creator
		
	QmlDesginer.contextPane: fix rewriting/undo stack
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user