diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-10-11 15:05:35 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-10-16 08:29:18 +0000 |
commit | 53ce9d53d553ed8cd988fec6d32c9198fa929e38 (patch) | |
tree | fcad8a4b76b6b9898d8922c389bdc4148975ca23 | |
parent | 7f47efe5beb4fb2a7ef39d7e2f61fedce9ac3121 (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.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 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; } |