aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-10-11 15:05:35 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-10-16 08:29:18 +0000
commit53ce9d53d553ed8cd988fec6d32c9198fa929e38 (patch)
treefcad8a4b76b6b9898d8922c389bdc4148975ca23
parent7f47efe5beb4fb2a7ef39d7e2f61fedce9ac3121 (diff)
Loader: Restore candidates when switching preferred value
... on the final module properties merge. Fixes: QBS-1763 Change-Id: Ie57f0e493ffb90a36cd0c6cd9c1bd48ccac0e42f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--src/lib/corelib/loader/modulepropertymerger.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/corelib/loader/modulepropertymerger.cpp b/src/lib/corelib/loader/modulepropertymerger.cpp
index abadd5b34..a789d1adc 100644
--- a/src/lib/corelib/loader/modulepropertymerger.cpp
+++ b/src/lib/corelib/loader/modulepropertymerger.cpp
@@ -287,6 +287,11 @@ bool ModulePropertyMerger::doFinalMerge(const PropertyDeclaration &propertyDecl,
if (propertyValue == chosenValue)
return false;
+ std::vector<ValuePtr> candidates = propertyValue->candidates();
+ candidates.erase(std::find(candidates.begin(), candidates.end(), chosenValue));
+ chosenValue->setCandidates(candidates);
+ chosenValue->addCandidate(propertyValue);
+ propertyValue->setCandidates({});
propertyValue = chosenValue;
return true;
}