diff options
author | David Schulz <david.schulz@qt.io> | 2019-10-01 14:51:13 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2019-10-02 10:32:31 +0000 |
commit | 6d5c61b164fd5e0f59be93ccb36b9126f6a11114 (patch) | |
tree | e8c8e98f48e59a52f05617e3317ea6e38f1a2f2a /src/plugins/python | |
parent | aa8ce0ba24c3fc99b13b0f45932035ee6fd0e068 (diff) | |
download | qt-creator-6d5c61b164fd5e0f59be93ccb36b9126f6a11114.tar.gz |
Python: Add virtual env name to auto detected interpreters
Change-Id: Ia4d2e5399aa983b6bca510ca8b0e6848da5f769a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'src/plugins/python')
-rw-r--r-- | src/plugins/python/pythonsettings.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 839d3f4451..be1ad7b4ee 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -287,6 +287,9 @@ Interpreter interpreterForPythonExecutable(const FilePath &python, name = defaultName; if (windowedSuffix) name += " (Windowed)"; + QDir pythonDir(python.parentDir().toString()); + if (pythonDir.exists() && pythonDir.exists("activate") && pythonDir.cdUp()) + name += QString(" (%1 Virtual Environment)").arg(pythonDir.dirName()); return Interpreter{QUuid::createUuid().toString(), name, python}; } |