diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-10-17 16:15:59 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-10-18 07:48:37 +0000 |
commit | b239b3a104e9ca249dec16eab29649ffe8c5b5a7 (patch) | |
tree | 7c953db49c88f92a169ff1e2569f8156bdbb7cf8 /src/lib | |
parent | cb0e12ac3a7538aeb865103788429f18fdd84100 (diff) |
Loader: Emit a proper error when binding to module properties
... in Project items.
This can only happen for the pseudo-qbs module that we load for Project
items.
Fixes: QBS-1752
Change-Id: I34fae59e14bcd2d3c06aedcf43d5c93583a3a5de
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/corelib/loader/modulepropertymerger.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/corelib/loader/modulepropertymerger.cpp b/src/lib/corelib/loader/modulepropertymerger.cpp index a789d1adc..c9dd56ccf 100644 --- a/src/lib/corelib/loader/modulepropertymerger.cpp +++ b/src/lib/corelib/loader/modulepropertymerger.cpp @@ -176,6 +176,11 @@ void ModulePropertyMerger::mergePropertyFromLocalInstance( Item *loadingItem, const QString &loadingName, Item *globalInstance, const QString &name, const ValuePtr &value) { + if (loadingItem->type() == ItemType::Project) { + throw ErrorInfo(Tr::tr("Module properties cannot be set in Project items."), + value->location()); + } + const PropertyDeclaration decl = globalInstance->propertyDeclaration(name); if (!decl.isValid()) { if (value->type() == Value::ItemValueType || value->createdByPropertiesBlock()) |