diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index 251bbf92b85..d8ea075273f 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -189,6 +189,7 @@ private: //variables QString m_rewritingErrorMessage; QString m_lastCorrectQmlSource; QTimer m_amendTimer; + bool m_instantQmlTextUpdate = false; }; } //QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index 8d6ba3ecc84..5cc829c528d 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -573,8 +573,13 @@ bool RewriterView::renameId(const QString& oldId, const QString& newId) && rootModelNode().hasBindingProperty(propertyName) && rootModelNode().bindingProperty(propertyName).isAliasExport(); + bool instant = m_instantQmlTextUpdate; + m_instantQmlTextUpdate = true; + bool refactoring = textModifier()->renameId(oldId, newId); + m_instantQmlTextUpdate = instant; + if (refactoring && hasAliasExport) { //Keep export alias properties rootModelNode().removeProperty(propertyName); PropertyName newPropertyName = newId.toUtf8(); @@ -675,7 +680,12 @@ void RewriterView::moveToComponent(const ModelNode &modelNode) { int offset = nodeOffset(modelNode); + bool instant = m_instantQmlTextUpdate; + m_instantQmlTextUpdate = true; + textModifier()->moveToComponent(offset); + + m_instantQmlTextUpdate = instant; } QStringList RewriterView::autoComplete(const QString &text, int pos, bool explicitComplete) @@ -736,7 +746,10 @@ void RewriterView::qmlTextChanged() } case Amend: { - m_amendTimer.start(400); + if (m_instantQmlTextUpdate) + amendQmlText(); + else + m_amendTimer.start(400); break; } }