diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-02 15:44:50 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-05 11:35:45 +0000 |
commit | 779095a587bbf389f34fdd569c7c17781971d407 (patch) | |
tree | e18c87bb62a7d89c68d5134554b555b1433c7918 /src/plugins/qtsupport/baseqtversion.h | |
parent | 5f682095415d1918c115e0d3937ddf38f24f1baa (diff) |
Fix crash in kit's variable chooser if Qt version is removed
Currently the variable chooser cannot update itself if a sub-expander
changes or even is deleted, leading to inconsistencies and crashes if
that happens.
Make the Qt version sub-macroexpander be available for the kit even if
currently is no Qt version selected. For this we create a macro expander
that delegates to the kit's Qt version if possible at variable
substitution time, instead of taking the Qt version's expander directly.
Task-number: QTCREATORBUG-19900
Task-number: QTCREATORBUG-19901
Change-Id: I2bd9b3db60bf6e292abf2a29e0697dc5385709cd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/baseqtversion.h')
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index e71f9b3a071..b1af4f955ee 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -232,6 +232,8 @@ public: QStringList qtConfigValues() const; Utils::MacroExpander *macroExpander() const; // owned by the Qt version + static std::unique_ptr<Utils::MacroExpander> createMacroExpander( + const std::function<BaseQtVersion *()> &qtVersion); static void populateQmlFileFinder(Utils::FileInProjectFinder *finder, const ProjectExplorer::Target *target); @@ -315,7 +317,7 @@ private: mutable QList<ProjectExplorer::Abi> m_qtAbis; - mutable Utils::MacroExpander m_expander; + std::unique_ptr<Utils::MacroExpander> m_expander; }; } |