aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythoneditor.cpp
diff options
context:
space:
mode:
authorJaime Resano <Jaime.Resano-Aisa@qt.io>2025-02-13 17:30:45 +0100
committerJaime Resano <Jaime.RESANO-AISA@qt.io>2025-03-11 13:41:54 +0000
commit2384da479caa9fe36e64d0f0f3f8f69fff06d6be (patch)
treefbf5a92e524045c732486870bd768ef29ce00949 /src/plugins/python/pythoneditor.cpp
parent69b9d6cb82d6231151258f880e3c579b4c2d4522 (diff)
Add pyproject.toml support for Python projects
This patch adds support for the standard Python project configuration file: pyproject.toml. It is intended to replace *.pyproject files. Task-number: QTCREATORBUG-22492 Task-number: PYSIDE-2714 Change-Id: I783ee7b49be23c61b0a501ef9bbd722cc652ad14 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
Diffstat (limited to 'src/plugins/python/pythoneditor.cpp')
-rw-r--r--src/plugins/python/pythoneditor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp
index ca8ecff0ee9..25424c2c1f9 100644
--- a/src/plugins/python/pythoneditor.cpp
+++ b/src/plugins/python/pythoneditor.cpp
@@ -146,12 +146,12 @@ void PythonEditorWidget::updateInterpretersSelector()
};
const FilePath documentPath = textDocument()->filePath();
- Project *project = Utils::findOrDefault(ProjectManager::projects(),
- [documentPath](Project *project) {
- return project->mimeType()
- == Constants::C_PY_PROJECT_MIME_TYPE
- && project->isKnownFile(documentPath);
- });
+ const auto isPythonProject = [documentPath](Project *project) {
+ return project->isKnownFile(documentPath) && (
+ project->mimeType() == Constants::C_PY_PROJECT_MIME_TYPE ||
+ project->mimeType() == Constants::C_PY_PROJECT_MIME_TYPE_TOML);
+ };
+ Project *project = Utils::findOrDefault(ProjectManager::projects(), isPythonProject);
if (project) {
auto interpretersGroup = new QActionGroup(menu);