QmlEditor: remove indirect QString::toUtf8/fromUtf8 roundtrip

Change-Id: Ie83ba8ff03834f10ef1b4d23827141817deb1bf3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2025-01-06 12:00:34 +01:00
parent a822f6db98
commit ac5ca391dd

View File

@@ -226,7 +226,7 @@ void QmlJSEditorPluginPrivate::reformatFile()
QmlJS::Document::MutablePtr latestDocument;
const Utils::FilePath fileName = m_currentDocument->filePath();
latestDocument = snapshot.documentFromSource(QString::fromUtf8(m_currentDocument->contents()),
latestDocument = snapshot.documentFromSource(m_currentDocument->plainText(),
fileName,
QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName));
latestDocument->parseQml();