Python: work with Interpreter in PythonRunConfiguration

This saves some unneeded file path conversion and lookups in the
python settings.

Change-Id: I8647858320183dc1da027363b4ab265f6c75e1ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-03-23 10:12:56 +01:00
parent 7cb3a726d4
commit bf5114dcee
3 changed files with 27 additions and 6 deletions

View File

@@ -31,18 +31,22 @@
namespace Python {
namespace Internal {
class Interpreter;
class PythonRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
Q_PROPERTY(bool supportsDebugger READ supportsDebugger)
Q_PROPERTY(QString interpreter READ interpreter)
Q_PROPERTY(QString interpreter READ interpreterPath)
Q_PROPERTY(QString mainScript READ mainScript)
Q_PROPERTY(QString arguments READ arguments)
public:
PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id);
QString interpreter() const;
Interpreter interpreter() const;
QString interpreterPath() const;
void setInterpreter(const Interpreter &interpreterId);
private:
void interpreterChanged();