summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2019-10-01 14:51:13 +0200
committerDavid Schulz <david.schulz@qt.io>2019-10-02 10:32:31 +0000
commit6d5c61b164fd5e0f59be93ccb36b9126f6a11114 (patch)
treee8c8e98f48e59a52f05617e3317ea6e38f1a2f2a /src/plugins/python
parentaa8ce0ba24c3fc99b13b0f45932035ee6fd0e068 (diff)
downloadqt-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.cpp3
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};
}