qmldocumentparser: adapt to changes in Dom for Qt 6.6

Add an if-guard so that it compiles for both 6.5 and 6.6.

Change-Id: I0d539c8b6b193218786dce33ac2a7f386209b622
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Sami Shalayel
2024-01-17 09:16:12 +01:00
parent 316e48fc50
commit 17b64c7ccd

View File

@@ -294,9 +294,16 @@ Storage::Synchronization::Type QmlDocumentParser::parse(const QString &sourceCon
QString filePath{m_pathCache.sourcePath(sourceId)};
environment.loadFile(
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
filePath,
filePath,
sourceContent,
QDateTime{},
#else
QQmlJS::Dom::FileToLoad::fromMemory(environment.ownerAs<QQmlJS::Dom::DomEnvironment>(),
filePath,
sourceContent),
#endif
[&](QmlDom::Path, const QmlDom::DomItem &, const QmlDom::DomItem &newItems) {
items = newItems;
},