diff options
| author | David Schulz <[email protected]> | 2023-11-01 15:05:03 +0100 |
|---|---|---|
| committer | David Schulz <[email protected]> | 2023-11-28 12:17:14 +0000 |
| commit | 09e94ae4ac040ad313b7b86e62489dee7cd3804a (patch) | |
| tree | 1e907c076ba18b326b413ed5ac551db4a3e5e380 /src/plugins/python/pythonbuildconfiguration.h | |
| parent | 12428bf1d67bd282c5276383c91d968451b44036 (diff) | |
Python: use kits page in python wizards
Change-Id: I1f7aaf145443481546abb868c8c167186600b848
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/python/pythonbuildconfiguration.h')
| -rw-r--r-- | src/plugins/python/pythonbuildconfiguration.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/plugins/python/pythonbuildconfiguration.h b/src/plugins/python/pythonbuildconfiguration.h new file mode 100644 index 00000000000..a4d9440bdb1 --- /dev/null +++ b/src/plugins/python/pythonbuildconfiguration.h @@ -0,0 +1,86 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include "pythonbuildsystem.h" + +#include <projectexplorer/abstractprocessstep.h> +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/buildstep.h> + + +namespace ProjectExplorer { class Interpreter; } +namespace Python::Internal { + +class PipPackageInfo; +class PySideUicExtraCompiler; + +class PySideBuildStep : public ProjectExplorer::AbstractProcessStep +{ + Q_OBJECT +public: + PySideBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); + ~PySideBuildStep(); + + void checkForPySide(const Utils::FilePath &python); + + QList<PySideUicExtraCompiler *> extraCompilers() const; + + static Utils::Id id(); + +private: + void checkForPySide(const Utils::FilePath &python, const QString &pySidePackageName); + void handlePySidePackageInfo(const PipPackageInfo &pySideInfo, + const Utils::FilePath &python, + const QString &requestedPackageName); + + Tasking::GroupItem runRecipe() final; + void updateExtraCompilers(); + + std::unique_ptr<QFutureWatcher<PipPackageInfo>> m_watcher; + QMetaObject::Connection m_watcherConnection; + + Utils::FilePathAspect m_pysideProject{this}; + Utils::FilePathAspect m_pysideUic{this}; + QList<PySideUicExtraCompiler *> m_extraCompilers; +}; + +class PySideBuildStepFactory : public ProjectExplorer::BuildStepFactory +{ +public: + PySideBuildStepFactory(); +}; + +class PythonBuildConfiguration : public ProjectExplorer::BuildConfiguration +{ + Q_OBJECT +public: + PythonBuildConfiguration(ProjectExplorer::Target *target, const Utils::Id &id); + + ProjectExplorer::NamedWidget *createConfigWidget() override; + void fromMap(const Utils::Store &map) override; + void toMap(Utils::Store &map) const override; + ProjectExplorer::BuildSystem *buildSystem() const override; + + Utils::FilePath python() const; + std::optional<Utils::FilePath> venv() const; + +private: + void initialize(const ProjectExplorer::BuildInfo &info); + void updateInterpreter(const std::optional<ProjectExplorer::Interpreter> &python); + void updatePython(const Utils::FilePath &python); + void handlePythonUpdated(const Utils::FilePath &python); + + Utils::FilePath m_python; + std::optional<Utils::FilePath> m_venv; + std::unique_ptr<PythonBuildSystem> m_buildSystem; +}; + +class PythonBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationFactory +{ +public: + PythonBuildConfigurationFactory(); +}; + +} // namespace Python::Internal |
