aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythonbuildsystem.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-11-01 15:05:03 +0100
committerDavid Schulz <david.schulz@qt.io>2023-11-28 12:17:14 +0000
commit09e94ae4ac040ad313b7b86e62489dee7cd3804a (patch)
tree1e907c076ba18b326b413ed5ac551db4a3e5e380 /src/plugins/python/pythonbuildsystem.cpp
parent12428bf1d67bd282c5276383c91d968451b44036 (diff)
Python: use kits page in python wizards
Change-Id: I1f7aaf145443481546abb868c8c167186600b848 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonbuildsystem.cpp')
-rw-r--r--src/plugins/python/pythonbuildsystem.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/python/pythonbuildsystem.cpp b/src/plugins/python/pythonbuildsystem.cpp
index 5754063d858..e46e33497bc 100644
--- a/src/plugins/python/pythonbuildsystem.cpp
+++ b/src/plugins/python/pythonbuildsystem.cpp
@@ -3,7 +3,9 @@
#include "pythonbuildsystem.h"
+#include "pythonbuildconfiguration.h"
#include "pythonconstants.h"
+#include "pythonkitaspect.h"
#include "pythonproject.h"
#include "pythontr.h"
@@ -116,11 +118,15 @@ static QStringList readImportPathsJson(const FilePath &projectFile, QString *err
return importPaths;
}
-PythonBuildSystem::PythonBuildSystem(Target *target)
- : BuildSystem(target)
+PythonBuildSystem::PythonBuildSystem(PythonBuildConfiguration *buildConfig)
+ : BuildSystem(buildConfig)
{
- connect(target->project(), &Project::projectFileIsDirty, this, [this] { triggerParsing(); });
- triggerParsing();
+ connect(project(),
+ &Project::projectFileIsDirty,
+ this,
+ &PythonBuildSystem::requestDelayedParse);
+ m_buildConfig = buildConfig;
+ requestParse();
}
bool PythonBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const
@@ -159,6 +165,12 @@ void PythonBuildSystem::triggerParsing()
auto newRoot = std::make_unique<PythonProjectNode>(projectDirectory());
+ FilePath python;
+ if (m_buildConfig)
+ python = m_buildConfig->python();
+ else if (auto kitPython = PythonKitAspect::python(kit()))
+ python = kitPython->command;
+
const FilePath projectFile = projectFilePath();
const QString displayName = projectFile.relativePathFrom(projectDirectory()).toUserOutput();
newRoot->addNestedNode(
@@ -178,6 +190,7 @@ void PythonBuildSystem::triggerParsing()
bti.targetFilePath = entry.filePath;
bti.projectFilePath = projectFile;
bti.isQtcRunnable = entry.filePath.fileName() == "main.py";
+ bti.additionalData = QVariantMap{{"python", python.toSettings()}};
appTargets.append(bti);
}
}