Utils: add convenience function to ChangeSet

Creating a QTextCursor just for the ChangeSet gives no benefit for the
calling code, but reduces the readability.

Change-Id: I34acb6083b6f7ab54fce042e29cd6e80498338ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2023-07-04 11:15:26 +02:00
parent e1c97d4e47
commit 81e8c67686
6 changed files with 12 additions and 8 deletions

View File

@@ -318,8 +318,7 @@ void QuickToolBar::removeProperty(const QString &propertyName)
Utils::ChangeSet changeSet;
Rewriter rewriter(m_doc->source(), &changeSet, m_propertyOrder);
rewriter.removeBindingByName(initializer, propertyName);
QTextCursor tc(m_editorWidget->document());
changeSet.apply(&tc);
changeSet.apply(m_editorWidget->document());
}
}
}