Implementation using python invocation using qprocess
This commit is contained in:
parent
cd67e8ddd7
commit
66937e2cfc
7 changed files with 174 additions and 1 deletions
26
pythonrunner.cpp
Normal file
26
pythonrunner.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
#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();
|
||||
}
|
||||
}
|
||||
|
||||
#include "pythonrunner.moc"
|
||||
Loading…
Add table
Add a link
Reference in a new issue