eismultiplexer-qt/pythonrunner.cpp
2025-10-13 16:53:56 +02:00

25 lines
571 B
C++

#include "pythonrunner.h"
#include "pythonembed.h"
PythonRunner::PythonRunner(QTextEdit* outputWidget, QObject* parent)
: QObject(parent), m_outputWidget(outputWidget), m_pythonEmbed(nullptr) {
m_pythonEmbed = new PythonEmbed(m_outputWidget, this);
}
PythonRunner::~PythonRunner() {
delete m_pythonEmbed;
}
void PythonRunner::runScript(const QString& scriptContent) {
if (m_pythonEmbed) {
m_pythonEmbed->runScript(scriptContent);
}
}
void PythonRunner::stopScript() {
if (m_pythonEmbed) {
m_pythonEmbed->stopScript();
}
}