Support merged QML import paths with header paths

QUL does not have separate QML import paths, but (re-)uses the include
paths for this purpose. Support this behavior by adding all include
paths to the QML import paths before handing the project information off
to the QML code model.

Change-Id: Ic2e39ab69ac27776f5070b7b8b7c66d53a83210b
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
Erik Verbruggen
2021-02-26 14:33:34 +01:00
committed by Erik Verbruggen
parent 6a838d7c3c
commit 2361f26732
6 changed files with 50 additions and 10 deletions

View File

@@ -680,10 +680,12 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc
k->setDeviceTypeForIcon(DEVICE_TYPE);
k->setValue(QtSupport::SuppliesQtQuickImportPath::id(), true);
k->setValue(QtSupport::KitQmlImportPath::id(), QVariant(sdkPath + "/include/qul"));
k->setValue(QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), true);
QSet<Id> irrelevant = {
SysRootKitAspect::id(),
QtSupport::SuppliesQtQuickImportPath::id(),
QtSupport::KitQmlImportPath::id()
QtSupport::KitQmlImportPath::id(),
QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(),
};
if (!kitNeedsQtVersion())
irrelevant.insert(QtSupport::QtKitAspect::id());
@@ -1027,6 +1029,16 @@ void McuSupportOptions::fixExistingKits()
}
}
}
// Check if the MCU kit has the flag for merged header/qml-import paths set.
const auto mergedPaths = QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id();
if (!irrelevantAspects.contains(mergedPaths)) {
irrelevantAspects.insert(mergedPaths);
kit->setIrrelevantAspects(irrelevantAspects);
}
if (!kit->value(mergedPaths, false).toBool()) {
kit->setValue(mergedPaths, true);
}
}
// Fix kit dependencies for known targets